Closed
Bug 1488336
Opened 6 years ago
Closed 6 years ago
sourceeditor setAutocompletionText could be faster
Categories
(DevTools :: Shared Components, enhancement, P1)
DevTools
Shared Components
Tracking
(firefox64 fixed)
RESOLVED
FIXED
Firefox 64
Tracking | Status | |
---|---|---|
firefox64 | --- | fixed |
People
(Reporter: nchevobbe, Assigned: nchevobbe)
Details
Attachments
(1 file)
In setAutocompletionText [1] , we do 2 things:
- clear any previous autocompletion mark that might exist
- then, if the text provided isn't falsy, add a new autocompletion mark
Each operation seems to trigger 2 reflows (so 4 reflows for setting the text), which can be quite an issue if the reflows are slow (e.g. the console panel lately).
We can probably make this better by grouping clearing marks and adding the new one in a codemirror operation [2].
[1] https://searchfox.org/mozilla-central/rev/c3fef66a5b211ea8038c1c132706d02db408093a/devtools/client/sourceeditor/editor.js#1296-1310
[2] https://codemirror.net/doc/manual.html#operation
Assignee | ||
Comment 1•6 years ago
|
||
This way, codeMirror does not trigger so many reflows and
makes setAutocompletionText faster.
An unwanted side-effect was that it made closing the console
a lot slower. Looking at the closing code of the JsTerm, we
do call setAutocompletionText("") in the end, which we don't
really need since we destroy the editor shortly after. Removing
this call keeps closing time the same as before.
Assignee | ||
Comment 2•6 years ago
|
||
Here's how typing in JsTerm performs with this patch: https://treeherder.mozilla.org/perf.html#/comparesubtest?originalProject=try&originalRevision=7f70127d7b1f10a8ce0bb074590f606beb52a30f&newProject=try&newRevision=f5b7a21562a4690a851a5cd33f58c199e099bb5e&originalSignature=d0aa31b4a8617d5bda9bc8c5ca7bfa9a77c38c7c&newSignature=d0aa31b4a8617d5bda9bc8c5ca7bfa9a77c38c7c&showOnlyImportant=1&framework=12
That's a solid ~30% improvement. For such a small patch this is quite nice :)
Here's a TRY push to make sure we don't break anything (looks good so far): https://treeherder.mozilla.org/#/jobs?repo=try&revision=6111fe91aff6ab87e9002489f1c1203acd37601a
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Priority: -- → P1
Comment 3•6 years ago
|
||
Comment on attachment 9006157 [details]
Bug 1488336 - Group clear mark and markText for completion text; r=bgrins.
Brian Grinstead [:bgrins] has approved the revision.
Attachment #9006157 -
Flags: review+
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3edd9e52dbfe
Group clear mark and markText for completion text; r=bgrins.
Comment 5•6 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox64:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 64
You need to log in
before you can comment on or make changes to this bug.
Description
•