Opaque performance issue using `.setValue`
See original GitHub issueIn two separate applications that both make use of .setValue
, Codemirror calls different functions internally.
It’s unclear to me why the performance is so radically different. I removed all calls to other functions and am now only calling .setValue
.
The one thing that is different in both applications are the CSS styles. One uses flexbox, the other fixed heights.
Here is the call-chain of functions called in either version. Can upload profiles as well. @marijnh any ideas?
FAST:
- anonymous
- anonymous
- makeChange
- makeChangeInner
- makeChangeSingleDoc
- makeChangeSingleDocInEditor
- startWorker
- Delayed.set
- setTimeout
- Delayed.set
- startWorker
- makeChangeSingleDocInEditor
- makeChangeSingleDoc
- makeChangeInner
- makeChange
- endOperation
- endOperations
- endOperation_W1
- updateDisplayIfNeeded
- patchDisplay
- updateForLineChanges
- updateLineText
- getLineContent
- buildLineContent
- replaceChild
- getLineContent
- updateLineText
- updateForLineChanges
- patchDisplay
- updateDisplayIfNeeded
- endOperationR2
- updateHeightsInViewport (selftime: 0.9 ms)
- endOperation_W1
- endOperations
- anonymous
Total Duration: 2.6 ms
SLOW:
- anonymous
- anonymous
- makeChange
- filterChange
- Codemirror.signal
- makeChangeInner
- computeSelAfterChange
- normalizeSelection
- addChangeToHistory
- historyChangeFromChange
- attachLocalSpans
- historyChangeFromChange
- computeSelAfterChange
- makeChangeSingleDoc
- makeChangeSingleDocInEditor
- estimateHeight (selftime: 202 ms)
- makeChangeSingleDocInEditor
- filterChange
- makeChange
- endOperation
- endOperations
- endOperation_R2
- updateHeightsInViewport (selftime: 215 ms)
- endOperation_finish
- postUpdateDisplay
- displayWidth (selftime: 230 ms)
- postUpdateDisplay
- endOperation_R2
- endOperations
- anonymous
Total Duration: 650 ms
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Opaque performance issue using .setValue #4076 - GitHub
The problem was that the Codemirror editor instance's height css property was set to inherit . Once we set a fixed height, we...
Read more >Improve performance on getting/setting values to properties ...
Improve performance on getting/setting values to properties on objects created from class created by reflection. Save this question. Show ...
Read more >Performance issues with setValue() - Retool Forum
I am setting the value of several Text Input fields in JS. Here is my code: var data = qrySources.data var rowID =...
Read more >JDK-8092373 Improve Path rendering performance - Bug ID
I have noticed that if the map is quite complex, the zoom operation is very slow. For example, with a map with 20000...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Use fixed width and height on the container of the editor element. On Thu, May 4, 2017 at 5:07 AM redlolgeerf notifications@github.com wrote:
Unfortunately, no. To ensure that things are drawn before they are scrolled into view, CodeMirror uses a very involved scrolling model for its container.