Giter Club home page Giter Club logo

lightweight-streams's Introduction

Lightweight Streams for Java

Build Status

This library employs the same pattern that the standard Java 8 library does but without iterators/spliterators and is based on lambdas/continuation-passing only. The programming model consists of combinators that wrap a source with a datatype which implements the LStream interface. Any combinators that are applied, effectively declare the transformations needed to be applied when an eager combinator is met.

source - lazy - lazy - lazy - eager

As in Java, boxing is avoided with hand specialized combinators (e.g. LongLStream).

The purpose of this library is to make the study of the lambda inlining decisions that the JVM makes easier.

Test

# run unit tests
mvn -q test

# build benchmarks über-jar
mvn clean package -Dskiptests

# run benchmarks
java -Xmx2g -Xms2g -XX:-TieredCompilation \
     -Dbenchmark.N=1000000 -Dbenchmark.F=3000000 -Dbenchmark.N_outer=10000 -Dbenchmark.N_inner=10 \
     -jar target/microbenchmarks.jar -wi 5 -i 5 -f 1 -gc true -tu ms ".*"

Measurements

in-progress

In C2, with large MaxInlineLevel, LStreams are slightly better in the cartesian product case, they are considerably slower in the sort case due to the sorting algorithm and in all other cases, numbers are similar.

In Graal, all megamorphic boxed/primitive LStreams with one lambda run 50-100% faster. Nearly all megamorphic primitive LStreams run considerably faster!

You can take a look at the most current measurements, that include baseline, LStreams and Java 8 Streams in the measurements files for both C2 and Graal:

References

Dependencies

lightweight-streams's People

Contributors

biboudis avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.