Bug 114030

Summary: Avoid double hash table lookups in TextureMapperGL
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebCore Misc.Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: cmarcelo, commit-queue, jturcotte, kenneth, laszlo.gombos, luiz, noam, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Chris Dumez
Reported 2013-04-05 06:03:26 PDT
In TextureMapperGL, we often need to check if a key is present in the hash table: - if it is return the associated value, - if it is not create the value, add it to the hash table and return it. We currently use Vector::find() to check if it exists, and then Vector::set() to add the value to the hash table if it doesn't. This results in 2 hash lookups. We could leverage the AddResult return value of Vector::add() to do the same thing with a single hash lookup.
Attachments
Patch (5.92 KB, patch)
2013-04-05 06:07 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2013-04-05 06:07:33 PDT
Noam Rosenthal
Comment 2 2013-04-05 06:16:42 PDT
Comment on attachment 196623 [details] Patch Seems a bit like a micro-optimization, as those cases only happen the first time you use a particular shader/vbo. But OK :)
WebKit Commit Bot
Comment 3 2013-04-05 06:24:28 PDT
Comment on attachment 196623 [details] Patch Clearing flags on attachment: 196623 Committed r147742: <http://trac.webkit.org/changeset/147742>
WebKit Commit Bot
Comment 4 2013-04-05 06:24:30 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.