Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[optimise] Avoid some double evaluation of RHS.
This is very speculative, and needs reviewed, but is theoretically safe, as it just feels like code rearrangement. In quickNodeSetCompare we evaluate RHS to decide if it is empty. In the case where it is not empty, we then look for an index to do comparison with; if there is no index, we defer to nodeSetCompare which throws away the RHS we just evaluated. So, instead check for an index first, that is cheap. If there is an index, do what we did before and evaluate RHS, checking for empty. If there is no index, defer straight to nodeSetCompare. Result is consistently 18.4s rather than 18.8s for 20 repetitions on the M1 Max 64.
- Loading branch information