Testcase inserting N "\n" is 1.8x slower in Firefox (time spent in comparing new value and old value which is required for dispatching change event)
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
| Performance Impact | none |
People
(Reporter: mayankleoboy1, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
|
1.63 KB,
text/html
|
Details |
Open testcase
"Number of empty strings" = 500000
Click on "Insert empty strings"
N=500k
Firefox Samply: https://share.firefox.dev/4jnh4LY (210s)
Chrome: https://share.firefox.dev/43tws3y (117s)
Firefox gecko profiler for 50k: https://share.firefox.dev/3Z2ul5u
Maybe something to improve?
Looks like that it takes a little bit long at comparing new value and old value which is required for dispatching change event later. We've already optimized a lot in the editor module about setting the value around ver. 57. I don't think we can optimize this more in the editor module level.
| Reporter | ||
Comment 2•1 year ago
|
||
Putting this into the general perf component.
| Reporter | ||
Updated•1 year ago
|
Comment 3•1 year ago
|
||
The severity field is not set for this bug.
:bas.schouten, could you have a look please?
For more information, please visit BugBot documentation.
Comment 4•1 year ago
|
||
Editor still feels like the right component to me.
Is there an example of a user facing issue resulting from this slowness? If there is please let me know so I can calculate the performance impact, and reset the performance impact flag to request re-triage.
No, at least there is no bottleneck in the editor module according to the profile.
- https://searchfox.org/mozilla-central/rev/5e24bf00212b4f5c053c1f8d943becf1b5bfd53c/dom/html/HTMLTextAreaElement.cpp#268
- https://searchfox.org/mozilla-central/rev/5e24bf00212b4f5c053c1f8d943becf1b5bfd53c/dom/base/nsContentUtils.cpp#7684
These are in the DOM module, the former is required to consider whether we should dispatch change event later and the latter is required to sanitize CRLFs. So, I don't have ideas to improve there in the DOM module.
FYI: Chrome also converts CRLFs to LFs.
data:text/html,<textarea></textarea><script>const textarea = document.querySelector("textarea"); textarea.value = "abc\r\ndef"; alert(textarea.value.replaceAll("\r\n", "CRLF"));</script>
shows:
abc
def
rather than
abcCRLFdef
Updated•1 year ago
|
Description
•