RESOLVED WONTFIX 24891
WebCore can be 600K smaller
https://bugs.webkit.org/show_bug.cgi?id=24891
Summary WebCore can be 600K smaller
Greg Bolsinga
Reported 2009-03-27 12:06:38 PDT
With exported C++ and Obj-C++ files in WebCore and WebKit, you'll see the C++ namespaces strings repeated often in the binaries. By renaming the namespaces (WebCore -> W, WTF -> F, JSC -> J) the total size of the 3 binaries can be reduced by ~600K, in my testing. This is extremely advantageous on memory constrained platforms. You can see some Obj-C++ strings in WebCore (via strings - <WebCoreLibrary>| grep WebCore) that are extremely long. These affect performance. We have learned that all of these strings are touched during library use. The smaller the library, and the shorter the strings the better on memory constrained platforms. This patch fixes this in a ham-handed way (#defines at in Platform.h) and post-processes the .exp files, but it is a proof of concept. Our performance team indicates this is a big win on our platform.
Attachments
Patch makes WebCore ~600K smaller (11.52 KB, patch)
2009-03-27 12:07 PDT, Greg Bolsinga
eric: review-
Greg Bolsinga
Comment 1 2009-03-27 12:07:28 PDT
Created attachment 29021 [details] Patch makes WebCore ~600K smaller This is a ham-handed patch so that this can be tested out for performance testing.
Greg Bolsinga
Comment 2 2009-03-27 16:00:36 PDT
And by indicates I mean believes. Testing is currently in progress.
Alexey Proskuryakov
Comment 3 2009-03-28 09:32:54 PDT
I would expect memory-constrained platforms to just strip the binary of all method names, for a much bigger win.
David Kilzer (:ddkilzer)
Comment 4 2009-03-28 11:43:24 PDT
(In reply to comment #3) > I would expect memory-constrained platforms to just strip the binary of all > method names, for a much bigger win. Objective-C method names can't be stripped, though, and some selectors in Objective-C++ source code (which include C++-mangled type names) are multiple *kilobytes*--for a single selector. That's where the benefit lies for this change.
Greg Bolsinga
Comment 5 2009-03-28 11:45:48 PDT
There are small size wins in JavaScriptCore as well, so it isn't just all Obj-C++.
Greg Bolsinga
Comment 6 2009-04-14 11:41:32 PDT
Greg Bolsinga
Comment 7 2009-04-17 09:20:59 PDT
Here's some bugs that address this problem at a better level: https://bugs.webkit.org/show_bug.cgi?id=25210 https://bugs.webkit.org/show_bug.cgi?id=25266
David Kilzer (:ddkilzer)
Comment 8 2009-05-09 14:29:48 PDT
How much is saved after fixing Bug 25210? Is this still worth doing?
Eric Seidel (no email)
Comment 9 2009-05-19 22:31:46 PDT
Comment on attachment 29021 [details] Patch makes WebCore ~600K smaller The patch looks great! Given your own reluctance in your last comment, I'm marking this r- for now. Please feel encouraged to re-mark this r=? if this should actually still be reviewed.
Greg Bolsinga
Comment 10 2009-07-31 15:04:46 PDT
I think the other bugs are better fixes for this, and iPhone already had a big win from Bug 25210. So I'm closing this as NTBF.
Note You need to log in before you can comment on or make changes to this bug.