Skip to content

Conversation

@triceo
Copy link
Collaborator

@triceo triceo commented Dec 21, 2025

The update queue does deduplicate the updates.
But we can skip iterating the entire collection, if we've already been over it once.

Another small bump in CS performance.

@Christopher-Chianelli Approach this with caution. I have seen this skip the collection more often than it iterates over it, but for that, the performance improvement is very small. There may be something I do not understand about this code.

Copy link
Contributor

@zepfred zepfred left a comment

Choose a reason for hiding this comment

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

I have a few minor suggestions for the hash logic to align it with Objects::hash.

@triceo
Copy link
Collaborator Author

triceo commented Jan 6, 2026

I removed all unrelated hashing changes.

@triceo triceo self-assigned this Jan 6, 2026
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 introduces a performance optimization for the precompute operation in the Bavet constraint solver by adding deduplication tracking to avoid redundantly iterating over tuple collections when the same object is updated multiple times within a single propagation cycle. Additionally, it includes minor code style improvements and an optimization to remove entries with empty tuple lists rather than storing them.

  • Adds alreadyUpdatingMap to track objects already processed in the current update cycle
  • Optimizes storage by removing empty mappings instead of storing empty lists
  • Standardizes code formatting across method signatures

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

The update queue does deduplicate the updates.
But we can skip iterating the entire collection, if we've already been over it once.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 6, 2026

@zepfred
Copy link
Contributor

zepfred commented Jan 6, 2026

I removed all unrelated hashing changes.

Okay, I'll skip the review then.

@triceo triceo merged commit 24eb6b3 into TimefoldAI:main Jan 6, 2026
34 checks passed
@triceo triceo deleted the precompute branch January 6, 2026 15:45
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.

3 participants