Code Monkey home page Code Monkey logo

cdi-performance's Introduction

A small application to run a lightweight micro benchmark for CDI beans.

Currently it only fires up 100 concurrent Threads and does 10 Million invocations on a very simple bean.

The numbers I've collected on my MBP15 so far:

All tests are run with Java7.

Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T18:37:52+01:00) Maven home: /opt/apache/maven Java version: 1.7.0_51, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre Default locale: de_DE, platform encoding: UTF-8 OS name: "mac os x", version: "10.10", arch: "x86_64", family: "mac"

OWB-1.2.6

$> mvn clean install
  • Test invocation on @ApplicationScoped bean which got injected into another @ApplicationScoped bean TOOK: 13 ms
  • Test invocation on ApplicationScoped bean TOOK: 20 ms
  • Test invocation on @RequestScoped bean TOOK: 648 ms

OWB-1.2.0

$> mvn clean install -Dowb.version=1.2.0
  • Test invocation on @ApplicationScoped bean which got injected into another @ApplicationScoped bean TOOK: 40 ms
  • Test invocation on ApplicationScoped bean TOOK: 18 ms
  • Test invocation on @RequestScoped bean TOOK: 918 ms

OWB-1.1.6

$> mvn clean install -Dowb.version=1.1.6
  • Test invocation on @ApplicationScoped bean which got injected into another @ApplicationScoped bean TOOK: 7138 ms
  • Test invocation on ApplicationScoped bean TOOK: 7008 ms
  • Test invocation on @RequestScoped bean TOOK: 11979 ms

OWB-1.1.8

$> mvn clean install -Dowb.version=1.1.8
  • Test invocation on @ApplicationScoped bean which got injected into another @ApplicationScoped bean TOOK: 7192 ms
  • Test invocation on ApplicationScoped bean TOOK: 6914 ms
  • Test invocation on @RequestScoped bean TOOK: 12111 ms

OWB-1.5.0-SNAPSHOT (CDI-1.2)

$> mvn clean install -POWB15 -Dowb.version=1.5.0-SNAPSHOT
  • Test invocation on @ApplicationScoped bean which got injected into another @ApplicationScoped bean TOOK: 23 ms
  • Test invocation on ApplicationScoped bean TOOK: 18 ms
  • Test invocation on @RequestScoped bean TOOK: 625 ms

Weld-1.1.23.Final

$> mvn clean install -PWeld -Dweld.version=1.1.23.Final
  • Test invocation on @ApplicationScoped bean which got injected into another @ApplicationScoped bean TOOK: 16258 ms
  • Test invocation on ApplicationScoped bean TOOK: 15447 ms
  • Test invocation on @RequestScoped bean TOOK: 2592 ms

Weld-2.2.5.Final

$> mvn clean install -PWeld -Dweld.version=2.2.5.Final
  • Test invocation on @ApplicationScoped bean which got injected into another @ApplicationScoped bean TOOK: 18408 ms
  • Test invocation on ApplicationScoped bean TOOK: 17812 ms
  • Test invocation on @RequestScoped bean TOOK: 2552 ms

Weld-2.2.6.Final

$> mvn clean install -PWeld -Dweld.version=2.2.6.Final
  • Test invocation on @ApplicationScoped bean which got injected into another @ApplicationScoped bean TOOK: 17751 ms
  • Test invocation on ApplicationScoped bean TOOK: 16916 ms
  • Test invocation on @RequestScoped bean TOOK: 2593 ms

disk footprint

I've also collected numbers about the size of all the jars needed:

OpenWebBeans-1.2.6

$> mvn clean dependency:copy-dependencies -DincludeScope=compile
$> du -hs target/dependency/
   952K target/dependency/

One can see that the flexible plugin structure of Apache OpenWebBeans really pays off.

Weld-2.2.6.Final

$> mvn clean dependency:copy-dependencies -DincludeScope=compile -PWeld
$> du -hs target/dependency/
3.8M    target/dependency/

[1] For @ApplicationScoped beans our proxies resolve the contextual instance only once. Thus you get the benefits of a Proxy (serializability, interceptors, decorators, cycle prevention, shield against scope differences) for the costs of (almost) native invocation (Creating 'underTest' via new instead of the CDI bean will run the test in 8ms).

cdi-performance's People

Contributors

struberg avatar mkouba avatar

Watchers

James Cloos 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.