Skip to content

Conversation

@HeikoKlare
Copy link
Contributor

The GC stores every operation changing the GC state to be able to repply it if a handle for a different zoom is requested. There are some operations which, if executing an operation of the same type subsequently, supercede each other. This, for example, applies to setting fonts, as when settings two fonts after each other, only the last one set is relevant.

This change flags several GC operations as replaceable and implements the removal of previous operations from the operation history if a new operation is executed that supercedes the previous one. This slightly reduces the memory footprint.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 28, 2025

Test Results

  118 files  ±0    118 suites  ±0   16m 14s ⏱️ + 1m 23s
4 650 tests ±0  4 633 ✅ ±0  17 💤 ±0  0 ❌ ±0 
  330 runs  ±0    326 ✅ ±0   4 💤 ±0  0 ❌ ±0 

Results for commit ff6e93a. ± Comparison against base commit b02fab8.

♻️ This comment has been updated with latest results.

@arunjose696
Copy link
Contributor

arunjose696 commented Oct 29, 2025

@HeikoKlare Just to confirm: the current logic only removes a replaceable operation if it’s immediately preceding the new one.
So in a sequence like setFont > setLineWidth > setFont, the first setFont stays in the list even though it’s superseded. would it make sense to remove the older setfonts, too ?

@HeikoKlare
Copy link
Contributor Author

Just to confirm: the current logic only removes a replaceable operation if it’s immediately preceding the new one.
So in a sequence like setFont > setLineWidth > setFont, the first setFont stays in the list even though it’s superseded. would it make sense to remove the older setfonts, too ?

That would add another requirement to replaceable operations: they must be commutative. I don't know if that is currently the case and it's quite prone to errors as you have to thoroughly check that all such marker operations are completely independent (commutative). While we may be able to do that right now, I would be afraid that future changes could easily break that if developers are not properly aware of this requirement. Or we would need a whole bunch of tests to ensure it.

So to conclude: the idea is definitely good, but I am not sure if it's worth the effort and, in particular, the risk coming along with it.

The GC stores every operation changing the GC state to be able to repply
it if a handle for a different zoom is requested. There are some
operations which, if executing an operation of the same type
subsequently, supercede each other. This, for example, applies to
setting fonts, as when settings two fonts after each other, only the
last one set is relevant.

This change flags several GC operations as replaceable and implements
the removal of previous operations from the operation history if a new
operation is executed that supercedes the previous one. This slightly
reduces the memory footprint.
@akoch-yatta akoch-yatta force-pushed the gc-supercede-operations branch from 463d1a7 to ff6e93a Compare October 30, 2025 08:04
Copy link
Contributor

@akoch-yatta akoch-yatta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good and works as expected. I tested some scenarios with the Runtime IDE and did not notice any regressions

@akoch-yatta akoch-yatta merged commit fd18da9 into eclipse-platform:master Oct 30, 2025
17 checks passed
@akoch-yatta akoch-yatta deleted the gc-supercede-operations branch October 30, 2025 08:24
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.

Obsolete GC operations in history

3 participants