Closed
Bug 1039162
Opened 9 years ago
Closed 9 years ago
Avoid some allocations in XPCOMUtils.jsm
Categories
(Core :: XPConnect, defect)
Tracking
()
RESOLVED
FIXED
mozilla33
People
(Reporter: n.nethercote, Assigned: n.nethercote)
References
Details
(Whiteboard: [MemShrink])
Attachments
(1 file, 1 obsolete file)
4.07 KB,
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
I have some patches to avoid some allocations in XPCOMUtils.jsm.
![]() |
Assignee | |
Comment 1•9 years ago
|
||
Attachment #8456664 -
Flags: review?(mrbkap)
![]() |
Assignee | |
Comment 2•9 years ago
|
||
Attachment #8456665 -
Flags: review?(mrbkap)
Comment 3•9 years ago
|
||
Comment on attachment 8456664 [details] [diff] [review] (part 1) - Don't use |for each| in XPCOMUtils.jsm Review of attachment 8456664 [details] [diff] [review]: ----------------------------------------------------------------- I guess for..of is bad too?
Updated•9 years ago
|
Attachment #8456664 -
Flags: review?(mrbkap) → review+
Comment 4•9 years ago
|
||
Comment on attachment 8456665 [details] [diff] [review] (part 2) - Don't delete properties unnecessarily in defineLazyGetter Review of attachment 8456665 [details] [diff] [review]: ----------------------------------------------------------------- Unfortunately, assigning to a property that only has a getter silently fails most of the time (though we should have thrown exceptions from uses of this in strict-mode code). In non-strict mode, the set silently does nothing and we'd end up calling the lambda for every use of the lazy property. Can you test to see what happens if, instead of simply setting the property, you change the getter to: var val = aLambda.apply(aObject); Object.defineProperty(aObject, aName, { enumerable: true, configurable: true, value: val }); return val; ?
Attachment #8456665 -
Flags: review?(mrbkap) → review-
![]() |
Assignee | |
Comment 5•9 years ago
|
||
> I guess for..of is bad too?
My instrumentation code says that for..of does *not* allocate objects.
![]() |
Assignee | |
Comment 6•9 years ago
|
||
> Can you test to see what happens if, instead of simply setting the property,
> you change the getter to:
>
> var val = aLambda.apply(aObject);
> Object.defineProperty(aObject, aName, { enumerable: true, configurable:
> true, value: val });
> return val;
It doesn't help -- shapes still get allocated. I'll just abandon part 2; it's effect was a lot smaller than part 1's.
![]() |
Assignee | |
Updated•9 years ago
|
Whiteboard: [MemShrink]
![]() |
Assignee | |
Comment 7•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/33ff09852b0a
Comment 8•9 years ago
|
||
sorry had to back this out for test failures like https://tbpl.mozilla.org/php/getParsedLog.php?id=44000597&tree=Mozilla-Inbound 73 INFO TEST-UNEXPECTED-FAIL | /tests/dom/network/tests/test_networkstats_alarms.html | uncaught exception - NS_ERROR_FACTORY_NOT_REGISTERED: at http://mochi.test:8888/tests/dom/network/tests/test_networkstats_alarms.html:182 and https://tbpl.mozilla.org/php/getParsedLog.php?id=43999859&tree=Mozilla-Inbound 23:24:12 INFO - System JS : ERROR resource://gre/modules/XPCOMUtils.jsm:111 - TypeError: interfaces is undefined 23:24:12 INFO - 50 INFO TEST-UNEXPECTED-FAIL | /tests/dom/bindings/test/test_bug707564.html | uncaught exception - NS_ERROR_FACTORY_NOT_REGISTERED: at http://mochi.test:8888/tests/dom/bindings/test/test_bug707564.html:17 23:24:12 INFO - JavaScript error: http://mochi.test:8888/tests/dom/bindings/test/test_bug707564.html, line 17: NS_ERROR_FACTORY_NOT_REGISTERED:
![]() |
Assignee | |
Comment 9•9 years ago
|
||
That's odd -- my try run didn't have those failures: https://tbpl.mozilla.org/?tree=Try&rev=ee1c31f278de
Comment 10•9 years ago
|
||
(In reply to Nicholas Nethercote [:njn] from comment #9) > That's odd -- my try run didn't have those failures: > https://tbpl.mozilla.org/?tree=Try&rev=ee1c31f278de yeah :( maybe because Linux itself was indeed (as the try run) super green and no failures. The failures were on B2G ICS Emulator Debug/Opt Tests
![]() |
Assignee | |
Comment 11•9 years ago
|
||
I have a new version of the patch, and the try run looks good: https://tbpl.mozilla.org/?tree=Try&rev=7d360d460269
![]() |
Assignee | |
Comment 12•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/e92292705a68
Updated•9 years ago
|
Attachment #8456665 -
Attachment is obsolete: true
Comment 13•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/e92292705a68
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in
before you can comment on or make changes to this bug.
Description
•