Non-linear performance with 1000 CodeMirrors on a single page
See original GitHub issueJupyterLab 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.
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:
- Created 3 years ago
- Comments:13 (5 by maintainers)
Top GitHub Comments
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.
@jasongrout, related: #6470.