4 ms·
Great point. In addition to caching, there's potential for branch prediction effects. This is why the JMH samples warn against including loops[0] of the operat
by hyperpape 7y ago
Great point. In addition to caching, there's potential for branch prediction effects.
This is why the JMH samples warn against including loops[0] of the operations you're trying to measure, and have an API that's designed to avoid the programmer having to every write their own looping code.
[0] https://hg.openjdk.java.net/code-tools/jmh/file/7bc6011260aa/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_11_Loops.java https://hg.openjdk.java.net/code-tools/jmh/file/7bc6011260aa...
- stygiansonic 7y agoGreat point about using JMH. As of JDK 12, it’s included in the SDK: https://openjdk.java.net/jeps/230 https://openjdk.java.net/jeps/230 What’s the equivalent of JMH for Python?
- hyperpape 7y agoI'm afraid I don't know, I really don't have any particular knowledge of performance engineering in Python.
- pvg 7y agoI'm not sure the JMH is meaningfully included in the JDK for others to use. The JDK happens to come with some JMH-based benchmarks in the source tree, that seems to be about it.