Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
28: Performance tweak for orient2d r=urschrei a=tinko92 This PR proposes a minor change for the test of the approximate result in orient2d. It removes the if-statements based on detleft and detright and uses abs directly. This reduces the number of branches in the common case (the approximate result is larger in magnitude than error bound) to one well-predictable branch, which improves performance on modern CPUs. This behavior was described in https://doi.org/10.1007/s10543-015-0574-9 by Ozaki et al. for the orient2d-predicate. Tested with `RUSTFLAGS='-C target-cpu=native' cargo bench` on the reverse dependencies spade (2-5% improvements for most benchmarks) and delaunator-rs (~12-13% improvement for most benchmarks). Co-authored-by: Tinko Bartels <[email protected]>
- Loading branch information