gsmiller commented on pull request #69:
URL: https://github.com/apache/lucene/pull/69#issuecomment-816040529
@jpountz
> +1 Let go with whichever of `arr[i] = IDENTITY_PLUS_ONE[i] * val + base`
or `arr[i] = (i+1) * val + base` runs fastest in your micro benchmark. We can
still improve things later if we find a way to trick the JVM into
auto-vectorizing this loop.
Perfect, thanks! I'm changing this back to `(i + 1) * val + base` because it
(somewhat surprisingly maybe, but I suppose this simple addition could be more
efficient than an array reference) does consistently perform slightly better in
microbenchmarks (`arraryRef == 0` is this implementation while `arrayRef == 1`
references `IDENTITY_PLUS_ONE[i]`):
```
Benchmark (arrayRef) (bitsPerValue)
(exceptionCount) (sameVal) Mode Cnt Score Error Units
PackedIntsDeltaDecodeBenchmark.pForDeltaDecoder 0 0
0 2 thrpt 20 7.915 ± 0.008 ops/us
PackedIntsDeltaDecodeBenchmark.pForDeltaDecoder 1 0
0 2 thrpt 20 7.695 ± 0.010 ops/us
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]