RESOLVED WONTFIX93793
Improve the use of strings in CSS
https://bugs.webkit.org/show_bug.cgi?id=93793
Summary Improve the use of strings in CSS
Benjamin Poulain
Reported 2012-08-12 22:47:41 PDT
Many CSS text accessors still have awful memory access pattern. It is hurting us on system with small CPU cache and slow memory, we should improve that.
Attachments
Patch (20.79 KB, patch)
2012-08-13 09:46 PDT, Benjamin Poulain
no flags
Patch (60.43 KB, patch)
2012-08-14 17:50 PDT, Benjamin Poulain
no flags
Patch (60.43 KB, patch)
2012-08-14 18:06 PDT, Benjamin Poulain
no flags
Archive of layout-test-results from gce-cr-linux-04 (397.66 KB, application/zip)
2012-08-14 19:02 PDT, WebKit Review Bot
no flags
Patch (60.91 KB, patch)
2012-08-14 20:27 PDT, Benjamin Poulain
no flags
Performance tests results for 158461 (92.35 KB, text/html)
2012-08-14 22:48 PDT, Perf EWS
no flags
Benjamin Poulain
Comment 1 2012-08-13 09:46:26 PDT
Benjamin Poulain
Comment 2 2012-08-14 17:50:45 PDT
Benjamin Poulain
Comment 3 2012-08-14 18:06:22 PDT
WebKit Review Bot
Comment 4 2012-08-14 19:02:37 PDT
Comment on attachment 158466 [details] Patch Attachment 158466 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13489978 New failing tests: fast/css/variables/variable-chain.html fast/backgrounds/repeat/parsing-background-repeat.html fast/css/variables/invalid-font-reference.html fast/css/remove-shorthand.html fast/css/variables/use-before-defined.html
WebKit Review Bot
Comment 5 2012-08-14 19:02:42 PDT
Created attachment 158477 [details] Archive of layout-test-results from gce-cr-linux-04 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: gce-cr-linux-04 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.39-gcg-201203291735-x86_64-with-Ubuntu-10.04-lucid
Benjamin Poulain
Comment 6 2012-08-14 20:27:39 PDT
Benjamin Poulain
Comment 7 2012-08-14 21:03:07 PDT
Comment on attachment 158490 [details] Patch Looks like I have addressed the two mistakes, so let's put this version for review. Something to be careful when reviewing: stringBuilder::toString() return String::empty(). Previously, some functions would have returned a null string instead of an empty string. I think I got them covered but I may have missed something so a careful review would be appreciated.
Perf EWS
Comment 8 2012-08-14 22:48:42 PDT
Created attachment 158506 [details] Performance tests results for 158461
Rafael Brandao
Comment 9 2012-08-15 07:11:19 PDT
Adding people that worked/reviewed similar stuff. From bug #81214, I recall some other optimizations like creating static strings for things like "-webkit-canvas(". ap once wondered about whether concatenating strings would be a good idea. I don't know what was concluded from there, but I think we should get rid of +/+= operator there.
Benjamin Poulain
Comment 10 2012-08-15 10:26:13 PDT
(In reply to comment #9) > Adding people that worked/reviewed similar stuff. From bug #81214, I recall some other optimizations like creating static strings for things like "-webkit-canvas(". What has been done in 81214 is a bad idea. We should update the code changed by 81214 with StringBuilder::appendLiteral once this lands. > ap once wondered about whether concatenating strings would be a good idea. I don't know what was concluded from there, but I think we should get rid of +/+= operator there. There are use cases for StringOperators. I do not agree at all we should get rid of operator+, it generally makes the code more readable and is efficient. If I have time, I have ideas to make it even faster.
Benjamin Poulain
Comment 11 2012-08-16 15:20:08 PDT
Comment on attachment 158490 [details] Patch I take this down for now. It looks like we can get even faster than this by changing StringOperators.
Benjamin Poulain
Comment 12 2012-08-16 17:30:38 PDT
I don't have time to get numbers for every single method. Let's kill this.
Note You need to log in before you can comment on or make changes to this bug.