Bug 81611 - Make CSSLonghandProperty use a lookup table instead of a hash map.
Summary: Make CSSLonghandProperty use a lookup table instead of a hash map.
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Luke Macpherson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-19 18:36 PDT by Luke Macpherson
Modified: 2012-03-22 16:53 PDT (History)
4 users (show)

See Also:


Attachments
Patch (19.04 KB, patch)
2012-03-19 18:36 PDT, Luke Macpherson
no flags Details | Formatted Diff | Diff
Patch (19.04 KB, patch)
2012-03-19 22:36 PDT, Luke Macpherson
no flags Details | Formatted Diff | Diff
Patch (18.98 KB, patch)
2012-03-19 23:47 PDT, Luke Macpherson
no flags Details | Formatted Diff | Diff
Hide singleton pattern behind inline static function (16.26 KB, patch)
2012-03-20 17:01 PDT, Luke Macpherson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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