Your interpretation is incorrect. The JEP says:
Add a basic suite of microbenchmarks to the JDK source code, and make it easy for developers to run existing microbenchmarks and create new ones.
i.e. this is not necessarily something that makes it into a JDK distribution, just something that is added to the source code repository to make it easier to run benchmarks on JDK code. Though, to be fair, the fact that it's listed as one of the JDK 12 'features' seems a tad misleading.
The benchmarks can be run by using the OpenJDK build system. Once you have cloned the OpenJDK source code from http://hg.openjdk.java.net/jdk/jdk/ (or another repository that includes the JEP), you can run benchmarks e.g. by using:
make test TEST="micro:java.lang.reflect"
Also, this requires you to specify JMH and it's dependencies when generating a build configuration:
bash configure --with-jmh="/path/to/jmh/jars"
博客内容解释了JEP267的含义,即在JDK源代码中引入一套基本的微基准测试,并使开发者能够方便地运行现有基准测试和创建新的。这并不意味着这些基准测试会直接包含在JDK发行版中,而是作为源代码库的一部分,便于性能测试。要运行基准测试,需要克隆OpenJDK源码并配置JMH。
5090

被折叠的 条评论
为什么被折叠?



