Relates :
|
|
Relates :
|
|
Relates :
|
For x%y, both Parse::do_irem and ModXNode::ideal are optimized for case that divisor y is 2^n constant value. It turns out that ModXNode::Ideal optimization is better than Parse::do_irem in microbenchmark: x64 ------------ ModXNode::Ideal opt: Benchmark Mode Cnt Score Error Units ModPowerOf2.testNegativePowerOf2 avgt 25 8746.608 ± 139.777 ns/op ModPowerOf2.testPositivePowerOf2 avgt 25 8735.545 ± 86.145 ns/op Parse::do_irem opt: Benchmark Mode Cnt Score Error Units ModPowerOf2.testNegativePowerOf2 avgt 25 8693.797 ± 7.844 ns/op ModPowerOf2.testPositivePowerOf2 avgt 25 6618.652 ± 1.739 ns/op AArch64 ------------ ModXNode::Ideal opt: Benchmark Mode Cnt Score Error Units ModPowerOf2.testNegativePowerOf2 avgt 25 6758.299 ± 4.452 ns/op ModPowerOf2.testPositivePowerOf2 avgt 25 6759.533 ± 2.791 ns/op Parse::do_irem opt: Benchmark Mode Cnt Score Error Units ModPowerOf2.testNegativePowerOf2 avgt 25 6757.868 ± 4.044 ns/op ModPowerOf2.testPositivePowerOf2 avgt 25 6546.034 ± 0.794 ns/op
|