在Java中测量单线程复杂算法的最佳宏基准测试工具/框架是什么? [英] What is the best macro-benchmarking tool / framework to measure a single-threaded complex algorithm in Java?

查看:92
本文介绍了在Java中测量单线程复杂算法的最佳宏基准测试工具/框架是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为我的Java代码(一种单线程,本地,复杂的算法)制定一些性能测量(主要是运行时)。 (所以我不想要宏基准来衡量JVM实现。)

I want to make some performance measures (mainly runtime) for my Java code, a single-threaded, local, complex algorithm. (So I do not want a macro-benchmark to measure a JVM implementation.)

使用该工具,我想


  • 分析复杂性,即查看我的代码如何缩放参数n(搜索深度)。 (我已经在n中进行了参数化的junit测试。)

  • 做一些趋势分析,如果对代码库的某些更改会使代码变慢,则会收到警告。

  • analyse the complexity, i.e. see how my code scales for a parameter n (the search depth). (I already have a junit test parameterized in n.)
  • do some trend analysis to get warned if some change to the code base makes the code slower.

为此,我想使用

    的工具或框架
  • 执行统计,以最佳方式计算平均值,标准差和置信区间。这非常重要。

  • 可以参数化(参见上面的参数n)。这也非常重要。

  • 能够制作出精美的情节,但不是必需的

  • 可以自动使用( junit-)测试警告我,如果我的程序运行缓慢,但这也不是必需的,只是一个加号。

  • does the statistics, optimally computing the mean value, standard deviation and confidence intervals. This is very important.
  • can be parameterized (see parameter n above). This is also very important.
  • is able to produce a fancy plot would be nice, but is not required
  • can be used in an automated (junit-)test to warn me if my program slows done, but this is also not required, just a plus.

什么工具/框架满足这些要求?哪一个适合复杂性和趋势分析,为什么?

What tools/frameworks fulfill these requirements? Which one would be well suited for complexity and trend analysis, and why?

推荐答案

下面是所有工具的按字母顺序排列的列表找到。提到的方面是:

Below is an alphabetical list of all the tools I found. The aspects mentioned are:


  • 是否可以轻松参数化

  • 它是Java库还是至少可以轻松集成到您的Java程序中

  • 可以处理JVM微基准测试,例如使用预热阶段

  • 可以直观地绘制结果

  • 可以持久存储测量值

  • 可以进行趋势分析以警告新提交导致速度减慢

  • 是否提供并使用统计数据(至少是最大值,最小值,平均值和标准差)。

  • is it easily parameterizable
  • is it a Java library or at least easily integratable into your Java program
  • can it handle JVM micro benchmarking, e.g. use a warmup phase
  • can it plot the results visually
  • can it store the measured values persistently
  • can it do trend analysis to warn that a new commit caused a slow down
  • does it provide and use statistics (at least max, min, average and standard deviation).

自动驾驶

Auto-pilot

可参数化; Perl库;没有JVM微基准测试;绘制;持久性;趋势分析!?;良好的统计数据(运行给定的测试直到结果稳定;突出异常值)。

parameterizable; Perl library; no JVM micro benchmarking; plotting; persistence; trend analysis!?; good statistics (run a given test until results stabilize; highlight outliers).

基准测试框架

Benchmarking framework

不可参数化; Java库; JVM微基准测试;没有密谋;没有坚持;没有趋势分析;统计数据。

not parameterizable; Java library; JVM micro benchmarking; no plotting; no persistence; no trend analysis; statistics.

统计数据是否非常好:除了平均值,最大值,最小值和标准差之外,它还计算95%置信区间(通过自举)和序列相关性(例如警告振荡执行时间,如果您的程序行为不确定,例如因为您使用HashSets,则会发生这种情况。它决定程序必须迭代以获得准确测量的频率,并将其解释为报告和警告(例如关于异常值和序列相关性)。

Does the statistics extremely well: besides average, max, min and standard deviation, it also computes the 95% confidence interval (via bootstrapping) and serial correlation (e.g. to warn about oscillating execution times, which can occur if your program behaves nondeterministically, e.g. because you use HashSets). It decides how often the program has to be iterated to get accurate measurements and interprets these for reporting and warnings (e.g. about outliers and serial correlation).

微基准测试也非常好(参见使用java创建快速/可靠的基准测试?以获取详细信息。)

Also does the micro-benchmarking extremely well (see Create quick/reliable benchmark with java? for details).

不幸的是,该框架带有一个util-package与许多其他帮助类捆绑在一起。基准类依赖于JSci(Java的科学API)和Mersenne Twister( http:// www.cs.gmu.edu/~sean/research/ )。如果作者Brent Boyer找到时间,他会将库煮沸并添加一个更简单的图示器,以便用户可以直观地检查测量结果,例如:关联和异常值。

Unfortunately, the framework comes in a util-package bundled together with a lot of other helper-classes. The benchmark classes depend on JSci (A science API for Java) and Mersenne Twister (http://www.cs.gmu.edu/~sean/research/). If the author, Brent Boyer, finds time, he will boil the library down and add a simpler grapher so that the user can visually inspect the measurements, e.g. for correlations and outliers.

Caliper

Caliper

可参数化; Java库; JVM微基准测试;绘制;持久性;没有趋势分析;统计数据。

parameterizable; Java library; JVM micro benchmarking; plotting; persistence; no trend analysis; statistics.

针对Android应用量身定制的相对较新的项目。看起来年轻但前途无量取决于Google Guava :(

Relatively new project, tailored towards Android apps. Looks young but promising. Depends on Google Guava :(

Commons monitoring

Commons monitoring

不可参数化!?; Java库;没有JVM微基准测试!?;绘图;通过servlet持久化;没有趋势分析!?;没有统计数据!?。

not parameterizable!?; Java library; no JVM micro benchmarking!?; plotting; persistence through a servlet; no trend analysis!?; no statistics!?.

支持AOP工具。

JAMon

JAMon

不可参数化; Java库;没有JVM微观基准测试;绘图,持久性和趋势分析以及其他工具(Jarep或JMX);统计数据。

not parameterizable; Java library; no JVM micro benchmarking; plotting, persistence and trend analysis with additional tools (Jarep or JMX); statistics.

良好的监控,与log4j交织在一起,数据也可以通过编程方式访问或查询您的程序可以对结果采取措施。

Good monitoring, intertwined with log4j, data can also be programmatically accessed or queried and your program can take actions on the results.

Java Simon

Java Simon

不可参数化??; Java库;没有JVM微技术基础rking;仅与Jarep密谋;仅使用JMX持久化;没有趋势分析;没有统计数据!?。

not parameterizable!?; Java library; no JVM micro benchmarking; plotting only with Jarep; persistence only with JMX; no trend analysis; no statistics!?.

Jamon的竞争对手,支持监视器等级。

Competitor of Jamon, supports a hierarchy of monitors.

JETM

JETM

不可参数化; Java库; JVM微基准测试;绘制;持久性;没有趋势分析;没有统计数据。

not parameterizable; Java library; JVM micro benchmarking; plotting; persistence; no trend analysis; no statistics.

不错的轻量级监控工具,没有依赖关系:)没有提供足够的统计信息(没有标准差),并且相应地扩展plugIn看起来相当困难(聚合器和聚合只有最小,最大和平均的固定吸气剂)。

Nice lightweight monitoring tool, no dependencies :) Does not offer sufficient statistics (no standard deviation), and extending the plugIn correspondingly looks quite difficult (Aggregators and Aggregates only have fixed getters for min, max and average).

jmeter

jmeter

可参数化!?; java库;没有JVM微基准测试!?;绘制;持久性;趋势分析!?;统计数据!?。

parameterizable!?; java library; no JVM micro benchmarking!?; plotting; persistence; trend analysis!?; statistics!?.

针对负载测试Web应用程序量身定制的优秀监控库。

Good monitoring library that is tailored towards load testing web applications.

< a href =http://openjdk.java.net/projects/code-tools/jmh/ =noreferrer> Java Microbenchmark线束( jmh

参数化(通过Java API自定义调用者); Java库; JVM微基准测试;没有情节;没有坚持;没有趋势分析;统计数据。

parametrizable (custom invokers via Java API); Java library; JVM microbenchmarking; no plots; no persistence; no trend analysis; statistics.

由Oracle的HotSpot专家构建的基准测试工具,因此非常适合在HotJot上进行微基准测试,用于OpenJDK性能工作。采取极端措施来提供可靠的基准环境。除了人类可读的输出之外,jmh还提供了一个Java API来处理结果,例如对于第三方策划者和持久性提供者。

The benchmarking harness built by Oracle's HotSpot experts, thus very suitable for microbenchmarking on HotSpot, used in OpenJDK performance work. Extreme measures are taken to provide the reliable benchmarking environment. Besides human-readable output, jmh provides a Java API to process the results, e.g. for 3rd party plotters and persistence providers.

junit-Benchmarks

junit-Benchmarks

可参数化; Java库; JVM微基准测试;绘制;持久性(使用CONSOLE,XML或数据库H2);图形趋势分析;统计数据(最大值,最小值,平均值,标准差;但不能轻易扩展以进一步统计)。

parameterizable; Java library; JVM micro benchmarking; plotting; persistence (using CONSOLE, XML or database H2); graphical trend analysis; statistics (max, min, average, standard deviation; but not easily extensible for further statistics).

只需在junit测试中添加junit-4规则:)

Simply add a junit-4-rule to your junit tests :)

junit-Benchmarks是Apache 2许可下的开源。

junit-Benchmarks is open source, under the Apache 2 licence.

更新 :项目移至 jmh

junitperf

junitperf

主要用于对性能进行趋势分析(使用JUnit测试装饰器 TimedTest )和可伸缩性(使用JUnit测试装饰器 LoadTest )。

Mainly for doing trend analysis for performance (with the JUnit test decorator TimedTest) and scalability (with the JUnit test decorator LoadTest).

可参数化; Java库;没有JVM微基准测试;没有密谋;没有坚持;没有统计数据。

parameterizable; Java library; no JVM micro benchmarking; no plotting; no persistence; no statistics.

perf4j

perf4j

不可参数化; Java库;没有JVM微基准测试;绘制;通过JMX持久化;通过log4j appender进行趋势分析;统计数据。

not parameterizable; Java library; no JVM micro benchmarking; plotting; persistence via JMX; trend analysis via a log4j appender; statistics.

构建日志框架,可以使用AOP。

Builds upon a logging framework, can use AOP.

Project Broadway

Project Broadway

非常一般的概念:监视器观察预定义的条件并指定满足它们时的反应方式。

Very general concept: monitors observe predefined conditions and specify how to react when they are met.

speedy-mcbenchmark

speedy-mcbenchmark

主要关注参数化:检查算法是否可扩展,即检查它是否为O(n),O(n log(n) ),O(n²)...

Main focus is on parameterizability: check whether your algorithm scales, i.e. check if it's O(n), O(n log(n)), O(n²)...

java库; JVM微基准测试;没有密谋;持久性;趋势分析;没有统计数据。

java library; JVM micro benchmarking; no plotting; persistence; trend analysis; no statistics.

The Grinder

The Grinder

可参数化; Jython图书馆;没有JVM微基准测试;绘制;持久性;没有趋势分析;没有好的统计数据,但很容易扩展。

parameterizable; Jython library; no JVM micro benchmarking; plotting; persistence; no trend analysis; no good statistics, but easily extensible.

取决于Jython,HTTPClient,JEditSyntax,ApacheXMLBeans,PicoContainer。

Depends on Jython, HTTPClient, JEditSyntax, ApacheXMLBeans, PicoContainer.

TPTP

TPTP

可参数化!?; Java工具平台;没有JVM微基准测试!?;绘制;持久性;图形趋势分析;没有统计数据!?

parameterizable!?; Java tool platform; no JVM micro benchmarking!?; plotting; persistence; graphical trend analysis; no statistics!?

The Test& Performance Tools Platform是一个巨大的通用和可扩展的工具平台(基于Eclipse和四个EMF模型)。因此它功能强大但相当复杂,可以减慢Eclipse速度,并根据自己的需要扩展它(例如,使用统计数据以便它们影响迭代次数)似乎非常困难。

The Test & Performance Tools Platform is a huge generic and extensible tool platform (based on Eclipse and four EMF models). Hence it is powerful but quite complex, can slow Eclipse down, and extending it for your own needs (e.g. with statistics so that they influence the number of iterations) seems to be very difficult.

Usemon

Usemon

可参数化!?; Java库;没有JVM微基准测试;绘制;持久性;趋势分析!?;统计数据!?。

parameterizable!?; Java library; no JVM micro benchmarking; plotting; persistence; trend analysis!?; statistics!?.

工具适用于大型集群中的监控。

Tool is tailored towards monitoring in large clusters.

这篇关于在Java中测量单线程复杂算法的最佳宏基准测试工具/框架是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆