Bug 81611

Summary: Make CSSLonghandProperty use a lookup table instead of a hash map.
Product: WebKit Reporter: Luke Macpherson <macpherson>
Component: New BugsAssignee: Luke Macpherson <macpherson>
Status: RESOLVED WONTFIX    
Severity: Normal CC: dglazkov, macpherson, menard, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Hide singleton pattern behind inline static function none

Description Luke Macpherson 2012-03-19 18:36:01 PDT
Make CSSLonghandProperty use a lookup table instead of a hash map.
Comment 1 Luke Macpherson 2012-03-19 18:36:46 PDT
Created attachment 132740 [details]
Patch
Comment 2 Luke Macpherson 2012-03-19 18:38:39 PDT
Hi Alexis, here is another idea for how you might do it. This way gives minimal code changes, while giving us very fast lookup performance.
Comment 3 Build Bot 2012-03-19 21:39:12 PDT
Comment on attachment 132740 [details]
Patch

Attachment 132740 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/11995065
Comment 4 Luke Macpherson 2012-03-19 22:36:19 PDT
Created attachment 132761 [details]
Patch
Comment 5 WebKit Review Bot 2012-03-19 23:23:48 PDT
Comment on attachment 132761 [details]
Patch

Attachment 132761 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11995118
Comment 6 Luke Macpherson 2012-03-19 23:47:14 PDT
Created attachment 132770 [details]
Patch
Comment 7 Alexis Menard (darktears) 2012-03-20 00:09:57 PDT
Comment on attachment 132770 [details]
Patch

Globally I feel https://bugs.webkit.org/show_bug.cgi?id=81587 much easier to read.
Comment 8 Luke Macpherson 2012-03-20 15:42:26 PDT
Do you mind comparing the lookup table with your switch-based implementation? I'm expecting that a straight lookup table like this will be slightly faster than the switch, and both should be faster than the existing HashMap, but it will be interesting to see.
Comment 9 Luke Macpherson 2012-03-20 15:46:07 PDT
(In reply to comment #7)
> (From update of attachment 132770 [details])
> Globally I feel https://bugs.webkit.org/show_bug.cgi?id=81587 much easier to read.

Do you mean because of the singleton pattern? You could easily hide that behind the same single static function and not change the interface at all.
Comment 10 Luke Macpherson 2012-03-20 17:01:04 PDT
Created attachment 132929 [details]
Hide singleton pattern behind inline static function