question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Non-linear performance with 1000 CodeMirrors on a single page

See original GitHub issue

JupyterLab notebook is using CodeMirrors (https://github.com/jupyterlab/jupyterlab/tree/master/packages/codemirror-extension) as default editor. Some users with large notebooks have issues with performance and we are working to resolve those.

We have done a few experiments adding 1000 codemirror on a single page (https://github.com/jupyterlab/benchmarks/blob/6f6878193c34be3d04385b49db484189e00cf79e/experiments/codemirror/src/index.tsx#L10-L26) and have seen exponential growth in time for each code mirror we are adding. We have used the contain css class to mitigate this, but still we think something could be done to have a linear time.

codemirror-contain

You can read more context on this deck https://jupyterlab-benchmarks-root-causes.echarles.vercel.app

Any tought on this will be very helpful to the JupyterLab community. If we can identify a fix, I am happy to open a PR on the CodeMirror code base.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
marijnhcommented, Nov 5, 2020

That… doesn’t look exponential by any means. And given that the CSS contain hack flattens it to almost linear, I’m not sure what you expect CodeMirror to be able to do about this.

Since each editor takes its layout from the DOM, and has different content and potentially different styling, I don’t see any meaningful way in which size calculations could be shared between editors.

0reactions
steveluschercommented, Nov 13, 2020

Are there some expensive calculations (measuring sizes, for example?)

@jasongrout, related: #6470.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Eliminate layout thrash in the hints widget · Issue #6470 - GitHub
https://github.com/codemirror/CodeMirror/blob/master/addon/hint/show ... Non-linear performance with 1000 CodeMirrors on a single page #6462.
Read more >
TiddlyWiki — a non-linear personal web notebook
Record every thought that crosses your brain, or build a flexible and responsive website. Introduction to TiddlyWiki. A Gentle Guide. What's New in...
Read more >
Using multiple CodeMirror editors on a single page?
I'd like these examples to be editable and runnable, so I thought I have these options : Use prettify to display code on...
Read more >
Automate Your Go Applications With Gradle & Docker - Morioh
The biggest challenge is the fact that web browsers really only support one programming language: JavaScript. However, as web technologies have advanced, ...
Read more >
CodeMirror
This is a CodeMirror field, configured for editing JavaScript code. ... Autocompletion. Provide language-specific completion hints in the editor.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found