Skip to content

QuickPerf

Jean Bisutti edited this page Mar 8, 2020 · 187 revisions
QuickPerf

QuickPerf is a testing library for Java providing annotations to quickly evaluate some performance properties.


Maven Central Β Β  License Β Β  Twitter Follow Β Β  Gitter Β Β  :octocat:


QuickPerf works with JUnit 4, JUnit 5, TestNG and a JDK 1.7+.

πŸ‘‰ Β  Project examples using QuickPerf available here and here (Maven)

Execute QuickPerf

Have clickable links in your IDE

Sometimes, QuickPerf can display a web url in the console. It is useful to have a clickable web url in your IDE, to be able to open it by a simple click.

Example of clickable web url

IntelliJ

Web URL are clickable since IntelliJ 2019.

For oldest versions, you can use Awesome console plugin.

πŸ’‘ If links are displayed on more one line, uncheck Use soft wraps in console (Editor -> General -> Console).

Use QuickPerf annotations

Annotation scopes

An annotation can have three scopes:

  • Global scope
    An annotation having a global scope applies on each test.
    You can define annotations with global scope by creating a class implementing SpecifiableGlobalAnnotations interface. This class has to be in org.quickperf package.
  • Test class scope
    An annotation having a test class scope overrides the configuration of the same annotation with global scope.
  • Test method scope
    An annotation having a test method scope overrides the configuration of the same annotation with test class and global scopes.

Example illustrating how annotation scopes work

Configure your test JVM

Verify heap allocation

Profile or check your JVM

Easily detect N+1 select, JDBC batching disabled and other things.

Disable QuickPerf

To disable QuickPerf features you can pass -DdisableQuickPerf=true to your JVM or use some core annotations (@DisableQuickPerf, @FunctionalIteration, @DisableGlobalAnnotations).

Project examples

Maven performance

Spring Boot - JUnit 4

Spring Boot - JUnit 5

Micronaut - JUnit 5

Annotations

πŸ‘‰ Β Core

πŸ‘‰ Β JVM

πŸ‘‰ Β SQL

πŸ‘‰ Β Scopes

πŸ‘‰ Β Create an annotation

Supported frameworks

πŸ‘‰ Β JUnit 4

πŸ‘‰ Β JUnit 5

πŸ‘‰ Β TestNG

πŸ‘‰ Β Spring

How to

πŸ‘‰ Β Detect and fix N+1 SELECT

Project examples

πŸ‘‰ Β Maven performance

πŸ‘‰ Β Spring Boot - JUnit 4

πŸ‘‰ Β Spring Boot - JUnit 5

πŸ‘‰ Β Micronaut Data - JUnit 5

πŸ‘‰ Β Micronaut - Spring - JUnit 5

πŸ‘‰ Β Quarkus - JUnit 5

Miscellaneous

πŸ‘‰ Β FAQ

πŸ‘‰ Β QuickPerf code

Clone this wiki locally