-1

I have gone through many articles on java JMH .But nothing specifies about the java JHM for complete java application performance testing ?? Is this the suitable tool for the same . If No, please support with suitable reason. Thanks in advance

2 Answers2

4

JMH is suitable for constructing loads on a a variety of scales, and offers some considerable advantages:

  • Easily peer reviewed
  • Many reporting outputs
  • Avoids many JVM benchmarking pitfalls
  • Embedded profiling capabilities
  • And more!

Does that mean it's a complete java application tool? No, and arguably no such tool exists for all applications. JMH is great for in process benchmarks/workloads. It's slightly awkward for latency under load workloads, but totally fine for all out throughput workloads. I've used it to benchmark Cassandra (as an example of a chunky server application), a Netty web server, libraries or small code snippets. Is the load real world? for a server application, embedding the clients and the server in the same JVM is definitely unrealistic, but that does not mean it is not useful and the convenience and extra features might make it worth while.

JMH can be used as a load generating harness for out of process applications with some effort. The embedded profilers won't work, but you'd be much better off than starting from scratch.

Nitsan Wakart
  • 2,841
  • 22
  • 27
-1

It depends on the application type and what type of performance testing you're looking for, to wit which metrics you are trying to collect and what are the non-functional requirements you need to cover. Originally JMH stands for Java Microbenchmark Harness and given micro word I don't think it can be used for end-to-end performance testing of any application, it is rather about a single function.

The common approach to performance testing assumes simulating real load, to wit you need to put your application under the same conditions like it will be used in production and the question is whether JMH provides possibility to implement this easily or not.

Personally I would recommend starting with profiling your application using something like JProfiler or YourKit at the same time putting your application under the load using a separate load testing tool like Apache JMeter

Dmitri T
  • 159,985
  • 5
  • 83
  • 133