Open
Bug 1853235
Opened 2 years ago
Updated 2 years ago
Avoid repeated null checks and mIsAnyMemberPresent assignments in dictionary initializers (e.g. EventModifierInit::Init)
Categories
(Core :: DOM: Bindings (WebIDL), enhancement)
Core
DOM: Bindings (WebIDL)
Tracking
()
NEW
People
(Reporter: mstange, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [sp3])
Here's the generated code for EventModifierInit::Init: https://searchfox.org/mozilla-central/source/__GENERATED__/dom/bindings/UIEventBinding.cpp#253
You can see that it has lots of repeated if (!isNull) { ... } checks and mIsAnyMemberPresent = true; assignments.
In the profile in bug 1851236, some samples are associated with those mIsAnyMemberPresent lines, so it seems that the repeated assignments are not optimized out, and probably the isNull checks aren't either.
It may improve things a tiny bit if we tightened this up a bit. For example, if we only have one mIsAnyMemberPresent = true; assignment after the first property, then the remaining individual isNull checks will probably get folded into one check by the compiler.
Updated•2 years ago
|
Whiteboard: [sp3]
Updated•2 years ago
|
See Also: → https://mozilla-hub.atlassian.net/browse/SP3-577
You need to log in
before you can comment on or make changes to this bug.
Description
•