matplotlib / matplotlib/ipympl

Optimizations

オープン
#103 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Jupyter Notebook
スター
1.7k
フォーク
234
PR マージ指標
30日以内にマージされた PR はありません

説明

I feel like there could be some optimizations concerning the image update.

  1. 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).

  1. 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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

参照されている matplotlib/backends/backend_webagg_core.py の画像更新コードから始め、ipympl における対応する canvas 更新のエントリーポイントを追跡してください。提案されているバイナリデータのパスを現在の PNG パスおよび diff パスと比較し、いずれか一方を変更する前にベンチマークと受け入れ基準を定義してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, python
領域
backend, frontend, performance
issue の種類
リファクタリング
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。