Skip to content

jayield/jayield-jmh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jayield-jmh

Follow the procedure to run JMH tests:

$ mvn clean install
$ java -jar target/benchmarks.jar

JAYield provides an extensible lazy sequence API, which reduces verbosity, keeps fluent query invocation and is faster than Java Stream API for sequential traversing with user-defined custom operations (e.g. oddLines or collapse).

In this work, we compare the performance of JAYield with the Java Stream API and with some of the most popular functional style Java libraries, such as Guava, StreamEx, JOOL, Cyclops, Vavr, and Protonpack.

We evaluated these libraries in a realistic use case based on data from the World Weather Online API for a small data set with past weather of Lisbon in February, March and April, corresponding to 93 days of weather information and performing 3 different queries:

  1. QueryMaxTemperature - maximum temperature;
  2. QueryNrOfDistinctTemperatures - count the number of distinct temperatures;
  3. QueryNrOfTemperaturesTransitions - count temperature transitions.

Each query results in a pipeline of:

  1. filter-skip-oddLines-mapToInt-max;
  2. filter-skip-oddLines-map-distinct-count;
  3. filter-skip-oddLines-map-collapse-count.

Note that oddLines and collapse are user-defined custom operations according to each library extension API.

The JAYield approach is is 2 fold faster than Java Stream on QueryMaxTemperature and 3 fold faster on QueryNrOfTemperaturesTransitions, which combines two custom operations (oddLines() and collapse()).

All other libraries also show worse performance than JAYield and furthermore, none of them provides an extensible fluent API as JAYield.

About

JMH micro-benchmarking evaluation of jayield

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages