matplotlib / matplotlib/ipympl
Question about performance
还没有人认领这个 Issue。
- 主要语言
- Jupyter Notebook
- 星标
- 1.7k
- 派生
- 234
- PR 合并指标
- 30 天内没有已合并 PR
描述
Describe the issue
I realise there has already been several issues opened about the performance of ipympl (e.g. #55), compared to other libraries that render in jupyter. But I still don't fully understand why the performance is so much worse than using e.g. the %matplotlib qt backend.
Take for example the 'Looking glass' example from the matplotlib docs.
The ineractivity is very nice in the Qt backend (more than enough for our purposes, even if not quite as snappy as javascript based libs such as bokeh or plotly), but terrible in jupyter lab (laggy and leaving phantom parts of the ellipse around the plot).
Is there really no way to improve the performance of interactivity in ipympl? (I have tried to use fig.canvas.draw_idle() instead of .draw(), and it helps a little but we are still so far behind the Qt backend.
Many thanks.
Versions
3.9.5 (default, Jun 4 2021, 12:28:51)
[GCC 7.5.0]
ipympl version: 0.8.2
Selected Jupyter core packages...
IPython : 7.29.0
ipykernel : 6.5.0
ipywidgets : 7.6.5
jupyter_client : 7.0.6
jupyter_core : 4.9.1
jupyter_server : 1.11.2
jupyterlab : 3.2.3
nbclient : 0.5.8
nbconvert : 6.3.0
nbformat : 5.1.3
notebook : 6.4.5
qtconsole : not installed
traitlets : 5.1.1
Known nbextensions:
config dir: /home/nvaytet/software/miniconda3/etc/jupyter/nbconfig
notebook section
ipycanvas/extension enabled
- Validating: OK
ipyevents/extension enabled
- Validating: OK
jupyter-datawidgets/extension enabled
- Validating: OK
jupyter-matplotlib/extension enabled
- Validating: OK
jupyter-threejs/extension enabled
- Validating: OK
jupyter_bokeh/extension enabled
- Validating: OK
jupyter_dash/main enabled
- Validating: OK
jupyterlab-plotly/extension enabled
- Validating: OK
jupyter-js-widgets/extension enabled
- Validating: OK
JupyterLab v3.2.3
/home/nvaytet/software/miniconda3/share/jupyter/labextensions
ipycanvas v0.12.0 enabled OK
ipyevents v2.0.1 enabled OK
jupyter-matplotlib v0.10.2 enabled OK
jupyterlab-datawidgets v7.0.0 enabled OK
jupyterlab-plotly v5.4.0 enabled OK
jupyter-threejs v2.3.0 enabled OK (python, pythreejs)
@jupyter-widgets/jupyterlab-manager v3.0.1 enabled OK (python, jupyterlab_widgets)
@bokeh/jupyter_bokeh v3.0.2 enabled OK (python, jupyter_bokeh)
Other labextensions (built into JupyterLab)
app dir: /home/nvaytet/software/miniconda3/share/jupyter/lab
jupyterlab-dash v0.4.0 enabled OK
Build recommended, please run `jupyter lab build`:
jupyterlab-dash needs to be included in build
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,在 JupyterLab 中使用 ipympl 重现 Looking Glass 示例,并将其交互行为与 Qt 后端进行比较。检查报告的 draw_idle 行为以及列出的 JupyterLab、ipympl 和 widget 版本;完成的标准是确定一个具体的性能原因,并定义交互式渲染中可测量的改进。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- jupyter, python
- 领域
- frontend, performance
- Issue 类型
- 缺陷
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 20/100