Skip to content

Conversation

arunjose696
Copy link
Contributor

When rendering images at a specific targetSize, the most recently created temporary handle is cached. If a handle of a different size is needed, the previous handle is disposed of and replaced with the new one. The last cached handle is also disposed of when the image itself is destroyed.

This change does not affect the visual appearance and is purely an optimization. It is especially useful when a user scrolls through a diagram, as the same-size image may be redrawn multiple times. Without handle caching, new image handles would need to be created repeatedly whenever the image is redrawn. More details can be found at vi-eclipse/Eclipse-Platform#326 (comment)

Copy link
Contributor

github-actions bot commented Oct 7, 2025

Test Results

  118 files  ±0    118 suites  ±0   11m 15s ⏱️ -38s
4 583 tests ±0  4 566 ✅ ±0  17 💤 ±0  0 ❌ ±0 
  330 runs  ±0    326 ✅ ±0   4 💤 ±0  0 ❌ ±0 

Results for commit ac8d6ec. ± Comparison against base commit 1eabfa3.

♻️ This comment has been updated with latest results.

Cache the most recently created temporary handle. When a handle of a different size is requested, dispose of the previous one and replace it with the new handle. The last cached handle is also destroyed when the image is disposed.
@arunjose696 arunjose696 force-pushed the arunjose696/469/cacheHandles branch from d897312 to ac8d6ec Compare October 7, 2025 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cache the last created temporary handles when image handles created at custom width and height
1 participant