matplotlib / matplotlib/ipympl
Optimizations
未关闭
还没有人认领这个 Issue。
- 主要语言
- Jupyter Notebook
- 星标
- 1.7k
- 派生
- 234
- PR 合并指标
- 30 天内没有已合并 PR
描述
I feel like there could be some optimizations concerning the image update.
- We should draw binary data directly on the canvas using:
context.putImageData(binary_data);
instead of creating a Blob that is png encoded. That would also allow the back-end to not waste time encoding into png (if that is possible).
- I feel like the "diff" computation should actually be slower than sending the full image, as it needs an extra computation of "which pixels actually needs a redraw?": https://github.com/matplotlib/matplotlib/blob/5fc44eea64a57ab1c6d236cf7c71906c9d40e6f6/lib/matplotlib/backends/backend_webagg_core.py#L190-L195.
Plus, we are still sending a full image. Maybe the png encoding does some compression if lots of pixels are transparent? If that is not the case, we are still sending the same amount of data.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从所引用的 matplotlib/backends/backend_webagg_core.py 图像更新代码开始,追踪 ipympl 中对应的 canvas 更新入口点。将提议的二进制数据路径与当前的 PNG 和 diff 路径进行比较,并在修改任一侧之前定义基准测试和验收标准。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, python
- 领域
- backend, frontend, performance
- Issue 类型
- 重构
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100