rmuir commented on a change in pull request #69: URL: https://github.com/apache/lucene/pull/69#discussion_r609185490
########## File path: lucene/core/src/java/org/apache/lucene/codecs/lucene90/PForUtil.java ########## @@ -121,4 +167,146 @@ void skip(DataInput in) throws IOException { in.skipBytes(forUtil.numBytes(bitsPerValue) + (numExceptions << 1)); } } + + /** + * Fill {@code longs} with the final values for the case of all deltas being 1. Note this assumes + * there are no exceptions to apply. + */ + private static void prefixSumOfOnes(long[] longs, long base) { + System.arraycopy(IDENTITY_PLUS_ONE, 0, longs, 0, ForUtil.BLOCK_SIZE); + // This loop gets auto-vectorized + for (int i = 0; i < ForUtil.BLOCK_SIZE; ++i) { + longs[i] += base; + } + } + + /** + * Fill {@code longs} with the final values for the case of all deltas being {@code val}. Note + * this assumes there are no exceptions to apply. + */ + private static void prefixSumOf(long[] longs, long base, long val) { + for (int i = 0; i < ForUtil.BLOCK_SIZE; i++) { + longs[i] = (i + 1) * val + base; Review comment: > I came across this [read](http://psy-lob-saw.blogspot.com/2015/07/jmh-perfasm.html) that seemed to indicate the need to run on "real hardware." I dont know about this. For me it works fine both on real hardware and inside QEMU vm, i see similar results for a simple test command passing the same arguments that jmh does behind the scenes: ``` perf record --freq 1000 --event cycles,instructions --output test.tmp dd if=/dev/urandom of=/dev/null bs=1M count=100 ``` If it says 0 samples, then something is off. hardware wise, I see the following config: ``` host$ journalctl -k | grep PMU kernel: Performance Events: PEBS fmt3+, Skylake events, 32-deep LBR, full-width counters, Intel PMU driver. guest$ journalctl -k | grep PMU kernel: Performance Events: Skylake events, full-width counters, Intel PMU driver. ``` -- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org