Optimizations
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Refactor
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript, python
- Domain
- backend, frontend, performance
Research direction
Start with the referenced matplotlib/backends/backend_webagg_core.py image-update code and trace the corresponding canvas update entry point in ipympl. Compare the proposed binary-data path with the current PNG and diff paths, and define benchmarks and acceptance criteria before changing either side.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Jupyter Notebook
- Stars
- 1.7k
- Forks
- 234
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from matplotlib/ipympl
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
matplotlib/ipympl#623 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
matplotlib/ipympl#622 · 13 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
matplotlib/ipympl#612 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
matplotlib/ipympl#611 · 4 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
matplotlib/ipympl#609 · 7 comments ·
All issues in matplotlib/ipympl
Similar issues
-
clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
growthbook/growthbook#7100 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
punkpeye/mcp-remote#369 ·
-
Client customer-reported needs-team-attention question Service Attention WebPubSub
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Azure/azure-sdk-for-net#63292 · 3 comments · 1 reaction ·
-
bug p:3-mid pydanty:bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
pydantic/pydantic-ai#8643 · 1 comment ·