Skip to content

Conversation

@triceo
Copy link
Collaborator

@triceo triceo commented Dec 12, 2025

In my benchmarks, I see speedups of 20-25 %.
This should significantly improve the viability of precompute.

Looking at the insert/retract logic, we probably over-designed this. The de-duplication is very heavy, for something that barely ever happens. But retracts and inserts also barely ever happen themselves, so this code doesn't show up in profiling at all and therefore I'm not touching it.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes the performance of precompute operations by eliminating intermediate data structures in the update path. The optimization removes the updateQueue from RecordAndReplayPropagator and delegates deduplication directly to StaticPropagationQueue, which already handles duplicate updates efficiently via tuple state checking.

Key Changes

  • Removed the intermediate updateQueue field and its associated processing overhead
  • Modified update() method to directly propagate updates to the tuple-level queue instead of collecting them at the object level
  • Simplified propagateUpdates() to directly delegate to the propagation queue

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
RecordAndReplayPropagator.java Removed updateQueue field and refactored update handling to bypass object-level queuing and deduplication, directly calling propagationQueue.update() for each tuple
PropagationQueue.java Added Javadoc clarifying that duplicate updates of the same item are deduplicated

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…ropagationQueue.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sonarqubecloud
Copy link

@triceo triceo merged commit 1cef560 into TimefoldAI:main Dec 12, 2025
34 checks passed
@triceo triceo deleted the propagate branch December 12, 2025 13:42
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.

2 participants