Skip to content

Conversation

@jgFages
Copy link
Contributor

@jgFages jgFages commented Jan 8, 2026

No description provided.

@jgFages jgFages requested a review from cprudhom January 8, 2026 11:28
@cprudhom
Copy link
Member

cprudhom commented Jan 8, 2026

Do you observe any performance improvement ?

@jgFages
Copy link
Contributor Author

jgFages commented Jan 8, 2026

For PropAbsolute, using removeInterval instead of removeValue enables to double the nb nodes per second

@jgFages jgFages marked this pull request as draft January 8, 2026 18:02
@jgFages jgFages marked this pull request as ready for review January 8, 2026 18:15
for (int v = -val; v <= val; v = Y.nextValue(v)) {
Y.removeValue(v, this, lcg() ? Reason.r(X.getValLit()) : Reason.undef());
if (val >= 0) {
Y.removeInterval(-val, val, lcg() ? Reason.r(X.getValLit()) : Reason.undef());
Copy link
Member

Choose a reason for hiding this comment

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

removeInterval is not compatible with lcg.

for (int v = 1 - min; v <= min - 1; v = Y.nextValue(v)) {
Y.removeValue(v, this, lcg() ? Reason.r(X.getMinLit()) : Reason.undef());
if (1 - min <= min -1) {
Y.removeInterval(1 - min, min - 1, lcg() ? Reason.r(X.getMinLit()) : Reason.undef());
Copy link
Member

Choose a reason for hiding this comment

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

same here.
We should either accept not to use removeInterval or use it only when LCg is disabled

Copy link
Member

Choose a reason for hiding this comment

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

I think calling System.gc() is useless.
Did you see any differences ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was just hoping it would be sufficient to solve the out of memory error in the github instance (it wasn't).

X.instantiateTo(Math.abs(Y.getValue()), this, lcg() ? Reason.r(Y.getValLit()) : Reason.undef());
setPassive();
} else if (Y.hasEnumeratedDomain()) {
} else if (Y.hasUnfixedEnumeratedDomain()) {
Copy link
Member

Choose a reason for hiding this comment

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

The condition seems correct but I think a little comment would help here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will move back to the original condition actually

@cprudhom cprudhom merged commit 868bb5e into xcsp Jan 15, 2026
11 checks passed
@cprudhom cprudhom deleted the JGF/FasterXYZ branch January 15, 2026 10:53
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