[webkit-dev] ThreadIdentifier abstraction is inefficient

Jens Alfke snej at chromium.org
Thu Oct 29 13:31:58 PDT 2009


The implementation of the ThreadIdentifier abstraction (in wtf/ 
ThreadingPthreads.cpp) is pretty inefficient. This makes calls like  
WTF::currentThread() a lot slower than you'd expect — that call is  
showing up as a hot spot in Chromium's JS/DOM bindings, believe it or  
not.

I filed a bug on this: https://bugs.webkit.org/show_bug.cgi?id=30922

My first suggestion is just to typedef ThreadIdentifier to pthread_t  
(if pthreads are in use) and avoid the need for a mapping altogether.  
Any reason this wouldn't be a good idea? (If not, I have two other  
suggestions in the bug report.)

—Jens


More information about the webkit-dev mailing list