Indentation of generated binding code is broken
Categories
(Core :: DOM: Bindings (WebIDL), defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox124 | --- | unaffected |
firefox125 | --- | fixed |
firefox126 | --- | fixed |
People
(Reporter: peterv, Assigned: sergesanspaille)
References
(Regression)
Details
(Keywords: regression)
Attachments
(2 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
Reporter | ||
Comment 1•7 months ago
|
||
The patch's comment just says that 're.sub is overkill here', but it sure looks to me like the patch does change the behaviour of the indent()
function to only indent the first line, as opposed to all the lines in the string.
Assignee | ||
Comment 2•7 months ago
|
||
According to ipython's %timeit:
>>> %timeit new_indent(a)
889 ns ± 5.54 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)
>>> %timeit ref_indent(a)
2.65 µs ± 7.08 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each)
where ref_indent is the reference function, regexular-expression-based
new_indent is the one proposed in this patch
a is a small multiline string:
>>> a = """
... csrvrsvsr
... csvfrz
... fvregvrg
... # frfger
...
... """
I've tested with
a = "errty" # small string
and
a = ("er" * 40 + '\n') * 100
and the split/join approach is always faster by a factor of at least 2.5
Updated•7 months ago
|
Assignee | ||
Comment 3•7 months ago
|
||
My fault. I've submitted an updated patch and added you as a reviewer.
Assignee | ||
Updated•7 months ago
|
Comment 4•7 months ago
|
||
Set release status flags based on info from the regressing bug 1884319
Updated•7 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
Comment 6•7 months ago
|
||
bugherder |
Comment 7•7 months ago
|
||
The patch landed in nightly and beta is affected.
:sergesanspaille, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox125
towontfix
.
For more information, please visit BugBot documentation.
Assignee | ||
Comment 8•7 months ago
|
||
wontfix: it's not affecting the behavior of firefox, just making the source less convenient to read.
Comment 9•7 months ago
|
||
(In reply to [:sergesanspaille] from comment #8)
wontfix: it's not affecting the behavior of firefox, just making the source less convenient to read.
It does affect looking at crashes inside binding code on beta and release. It doesn't come up all that often but it also looks like a low risk patch.
Updated•7 months ago
|
Comment 10•7 months ago
|
||
According to ipython's %timeit:
>>> %timeit new_indent(a)
889 ns ± 5.54 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)
>>> %timeit ref_indent(a)
2.65 µs ± 7.08 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each)
where ref_indent is the reference function, regexular-expression-based
new_indent is the one proposed in this patch
a is a small multiline string:
>>> a = """
... csrvrsvsr
... csvfrz
... fvregvrg
... # frfger
...
... """
I've tested with
a = "errty" # small string
and
a = ("er" * 40 + '\n') * 100
and the split/join approach is always faster by a factor of at least 2.5
Original Revision: https://phabricator.services.mozilla.com/D205061
Updated•7 months ago
|
Comment 11•7 months ago
|
||
Uplift Approval Request
- User impact if declined: No direct impact. It will make understanding crashes inside generated binding code more difficult, which is not very common.
- Risk associated with taking this patch: Low
- Fix verified in Nightly: yes
- String changes made/needed: none
- Steps to reproduce for manual QE testing: none
- Code covered by automated testing: yes
- Explanation of risk level: It just changes indentation in generated bindings code.
- Is Android affected?: yes
- Needs manual QE test: no
Updated•7 months ago
|
Comment 12•7 months ago
|
||
Uplift Approval Request
- User impact if declined: No direct impact. It will make understanding crashes inside generated binding code more difficult, which is not very common.
- Risk associated with taking this patch: Low
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: none
- Fix verified in Nightly: yes
- Code covered by automated testing: yes
- Explanation of risk level: It just changes indentation in generated bindings code.
- Is Android affected?: yes
- String changes made/needed: none
Updated•7 months ago
|
Updated•7 months ago
|
Comment 13•7 months ago
|
||
uplift |
Description
•