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

  115 files  ±0    115 suites  ±0   10m 54s ⏱️ +13s
4 546 tests ±0  4 531 ✅ ±0  15 💤 ±0  0 ❌ ±0 
  311 runs  ±0    308 ✅ ±0   3 💤 ±0  0 ❌ ±0 

Results for commit 2ae9c04. ± Comparison against base commit 84f0345.

♻️ This comment has been updated with latest results.

@arunjose696 arunjose696 force-pushed the arunjose696/469/cacheHandles branch from d897312 to ac8d6ec Compare October 7, 2025 11:37
@arunjose696 arunjose696 force-pushed the arunjose696/469/cacheHandles branch from ac8d6ec to f8e499a Compare October 13, 2025 08:43
@fedejeanne fedejeanne force-pushed the arunjose696/469/cacheHandles branch from f8e499a to 4a83dbe Compare October 13, 2025 08:48
@arunjose696 arunjose696 force-pushed the arunjose696/469/cacheHandles branch from 4a83dbe to 9f3a7d9 Compare October 13, 2025 16:12
@arunjose696 arunjose696 force-pushed the arunjose696/469/cacheHandles branch 3 times, most recently from e2cf1f7 to 4b25dcd Compare October 14, 2025 09:35
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.
@HeikoKlare HeikoKlare force-pushed the arunjose696/469/cacheHandles branch from 4b25dcd to 2ae9c04 Compare October 14, 2025 12:09
@HeikoKlare HeikoKlare merged commit 79e74c7 into eclipse-platform:master Oct 14, 2025
21 of 22 checks passed
@HeikoKlare HeikoKlare deleted the arunjose696/469/cacheHandles branch October 14, 2025 13:31
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

3 participants