costin commented on pull request #453: URL: https://github.com/apache/lucene/pull/453#issuecomment-973879755
I've done more benchmarking with a variant of Packed64 that uses the `VarHandle` `int` and `short` variant to read memory when dealing with a smaller bpv (<=32 for `int`, <=16 for `short`) instead of reading a full long. However performance takes a huge hit, an order of magnitude slower: ``` # VarHandle int (set): Packed64Benchmark.packed64 16 10240 thrpt 3 5653670.172 ± 2376991.321 ops/s Packed64Benchmark.packed64VarHandleDynamic 16 10240 thrpt 3 349186.319 ± 57043.802 ops/s Packed64Benchmark.packed64VarHandleLongAndByte 16 10240 thrpt 3 4856165.100 ± 265007.574 ops/s Packed64Benchmark.packed64VarHandleLongLong 16 10240 thrpt 3 5151665.941 ± 567170.748 ops/s # VarHandle short (set): Packed64Benchmark.packed64 15 10240 thrpt 3 5708794.814 ± 196465.456 ops/s Packed64Benchmark.packed64VarHandleDynamic 15 10240 thrpt 3 370572.965 ± 17435.808 ops/s Packed64Benchmark.packed64VarHandleLongAndByte 15 10240 thrpt 3 4980979.402 ± 305740.478 ops/s Packed64Benchmark.packed64VarHandleLongLong 15 10240 thrpt 3 4913621.842 ± 248031.886 ops/s ``` Changing to a direct array assignment (when dealing with bpv <= 8) improves performance a bit but still far from enough: ``` # Direct array assignment Benchmark (bpv) (size) Mode Cnt Score Error Units Packed64Benchmark.packed64 7 10240 thrpt 3 5711092.727 ± 373045.792 ops/s Packed64Benchmark.packed64VarHandleDynamic 7 10240 thrpt 3 459770.147 ± 10022.225 ops/s Packed64Benchmark.packed64VarHandleLongAndByte 7 10240 thrpt 3 5147663.602 ± 98164.084 ops/s Packed64Benchmark.packed64VarHandleLongLong 7 10240 thrpt 3 5161701.054 ± 182228.458 ops/s ``` -- 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. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org