Skip to Content
Java EE 8 High Performance
book

Java EE 8 High Performance

by Romain Manni-Bucau
January 2018
Intermediate to advanced
350 pages
9h 7m
English
Packt Publishing
Content preview from Java EE 8 High Performance

The state

Once you have the right dependencies, you can develop your benchmarks. The API is quite straightforward. It uses the notion of a state and a state has a life cycle and (volatile) storage associated with the benchmark. The life cycle of a state is defined by marking methods with:

  • @Setup to execute an initialization task
  • @Teardown to release any created resource in the setup method

State classes can also contain fields decorated with @Param to make them contextualized and configurable (such as enabling them to get a different target URL depending on the execution for example).

A state class is marked with @State, which takes, as parameter, the scope of the state instance for a benchmark:

  • Benchmark means the state will be a singleton ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java EE 8 Application Development

Java EE 8 Application Development

David R. Heffelfinger
Java 9 High Performance

Java 9 High Performance

Mayur Ramgir, Nick Samoylov
Java EE 8 Design Patterns and Best Practices

Java EE 8 Design Patterns and Best Practices

Rhuan Rocha, Joao Carlos Purificação

Publisher Resources

ISBN: 9781788473064Supplemental Content