Closed
Bug 273424
Opened 20 years ago
Closed 20 years ago
Option to disable obsolete vtable support [minimo]
Categories
(Core :: XPCOM, enhancement)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
People
(Reporter: darin.moz, Assigned: bryner)
References
Details
(Keywords: perf)
Attachments
(2 files, 1 obsolete file)
|
37.58 KB,
patch
|
darin.moz
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
|
38.46 KB,
patch
|
Details | Diff | Splinter Review |
Option to disable obsolete vtable support Minimo and other products that don't care about binary compatibility with Mozilla 1.4 can benefit from eliminating nsTAString::mVTable and all of the extra code associated with it. The solution is simple: implement all methods in nsTAString.h as inline wrappers around the corresponding methods on nsTSubstring or nsTString. This should give a significant codesize and performance benefit.
Comment 1•20 years ago
|
||
>The solution is simple: implement all methods in nsTAString.h as inline wrappers
>around the corresponding methods on nsTSubstring or nsTString.
hm, why not just:
typedef nsSubstring nsString;
?Summary: Option to disable obsolete vtable support → Option to disable obsolete vtable support [minimo]
| Reporter | ||
Comment 2•20 years ago
|
||
I suppose you meant: typedef nsSubstring nsAString, right? The problem is that people have coded |class nsAString;| all over the place. I tried to get rid of that before, by replacing them with |#include "nsStringFwd.h"|, but it became very difficult. (I don't remember the details.) Maybe it could still be done. The maintenance problem is compounded since this would only be an optional build mode. Of course, we do have a minimo tinderbox! ;-)
Comment 3•20 years ago
|
||
er, oops - yes, that is what I meant.
| Assignee | ||
Comment 4•20 years ago
|
||
This is one way we could do this with minimal code changes. I keep the classes pretty much the same, but I use the preprocessor to rename nsTAString_CharT to nsSubstring_base, and nsTSubstring_CharT to nsAString. I then #ifdef out all of the members and methods on nsSubstring_base, leaving just the typedefs. This was to avoid duplicating the typedefs. Most of the other changes were just removing duplicate methods (anything using abstract_string_type where there was also a substring_type version). Code size savings is about 60KB on windows and about 170KB on Mac (trunk Firefox). Haven't had a chance to test Linux, I'd estimate it's somewhere in the middle of those.
Attachment #170897 -
Flags: superreview?(darin)
Attachment #170897 -
Flags: review?(darin)
| Reporter | ||
Comment 5•20 years ago
|
||
Comment on attachment 170897 [details] [diff] [review] one way to do this >Index: configure.in >+MOZ_ARG_DISABLE_BOOL(v1-string-abi, >+[ --disable-v1-string-abi Disable binary compatibility layer for strings], >+ MOZ_1X_STRING_ABI=, nit: some inconsistency here... "v1" vs "1X"... can they be the same? >Index: xpcom/string/public/nsTSubstringTuple.h >+#else >+ typedef nsTSubstring_CharT abstract_string_type; >+#endif ... >+operator+(const nsTSubstringTuple_CharT::abstract_string_type& a, const nsTSubstringTuple_CharT::abstract_string_type& b) nit: would it be better to use operator_type here as well? Nice work! r+sr=darin
Attachment #170897 -
Flags: superreview?(darin)
Attachment #170897 -
Flags: superreview+
Attachment #170897 -
Flags: review?(darin)
Attachment #170897 -
Flags: review+
| Reporter | ||
Comment 6•20 years ago
|
||
When this lands, I'll throw this switch in the minimo-arm build on neptune. That'll help ensure that it doesn't bit-rot, and we'll get to see how much it helps codesize with that build.
| Assignee | ||
Comment 7•20 years ago
|
||
Changed MOZ_1X_STRING_ABI to MOZ_V1_STRING_ABI, and changed use of nsTSubstringTuple_CharT::abstract_string_type to just string_type.
Assignee: darin → bryner
Status: NEW → ASSIGNED
| Assignee | ||
Comment 8•20 years ago
|
||
After discussion with darin, decided to use base_string_type instead of string_type in nsTSubstringTuple and instead of operator_type in nsTSubstring.
Attachment #172204 -
Attachment is obsolete: true
| Assignee | ||
Comment 9•20 years ago
|
||
checked in
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Comment 10•20 years ago
|
||
The following errors occur when the "ac_add_options --disable-v1-string-abi" option is applied. https://bugzilla.mozilla.org/show_bug.cgi?id=235499#c39
| Reporter | ||
Comment 11•20 years ago
|
||
I enabled this option on the neptune minimo-arm tinderbox today, and it appears to have saved about 110k on the size of the resulting binary.
Updated•4 years ago
|
Component: String → XPCOM
You need to log in
before you can comment on or make changes to this bug.
Description
•