• hubbe@chromium.org's avatar
    make debug mode ~20% faster on linux · 82952dfb
    hubbe@chromium.org authored
    I was doing some benchmarking on tests on linux, and noticed that 10-20% of time was
    in ThreadCheckerImpl::CalledOnValidThread. I looked into it and found that we're doing
    a syscall to get the thread ID, which is not needed on any platform where pthread_t
    is already an integer type.  Replacing that syscall with pthread_self() makes this particular
    test (End2EndTest.BasicFakeSoftwareVideo) go from 488ms to 374ms, which is a 20% speedup.
    While other tests might not use ThreadChecker quite as much, it should still be a pretty
    good win across a large set of tests.
    
    Review URL: https://codereview.chromium.org/292873002
    
    git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272725 0039d316-1c4b-4281-b951-d872f2087c98
    82952dfb
thread_checker_impl.h 1.29 KB