If you have a lot of constraints of the form
:- #sum{ set(X…) = W } = SX, #sum{ set(Y…) = W2 } = SY, SX < SY.
they can horribly with all the different values that SX and SY could take.
A better way is to it like this:
:- #sum{ set(X…)=W, set(Y…)= – W2} < 0.
This doesn’t ground anywhere near as badly and caused a speed up of 40s -> under a second for me in one case.