Coder Social home page Coder Social logo

2.10.0-rc3-benchmark's Introduction

2.10.0-RC3-Benchmark

I saw this benchmark on this page. In comments someone asked reason of this improvement. I was sure this is due to new Implicit and Value Classes. Value Classes provide inlining instead of object creation at run-time. This means there should be less object allocation in scala 2.10. I used google's allocation instrumenter
to inspect object allocations. You can find it [here] (http://code.google.com/p/java-allocation-instrumenter/)

Usage

sbt assembly

This will create a jar file in target with name bench2.10.jar. You can change scala version and sbt version by manipulating build.sbt

java -javaagent:lib/allocation.jar -jar target/bench2.10.jar  1 1

This will instrument code and create a report. First Parameter for number of iterations on Sundaram second is for Eratosthenes

Results

30 times more allocation on Eratosthenes Becnmark with scala 2.9.2. Thats why it is so fast in 2.10

java -javaagent:lib/allocation.jar -jar target/bench2.10.jar  1 1
Sieve of Sundaram
___________________________

Cold results: 
	Average: 	5283.500000ms
	Median: 	6045ms
	Mode: 		4522ms
	Allocation: 	29353347

Warm results: 
	Average: 	4338.000000ms
	Median: 	4505ms
	Mode: 		4171ms
	Allocation: 	29368200    

Sieve of Eratosthenes
_______________________________

Cold results: 
	Average: 	1476.500000ms
	Median: 	1537ms
	Mode: 		1416ms
	Allocation: 	1061630

Warm results: 
	Average: 	1261.000000ms
	Median: 	1264ms
	Mode: 		1258ms
	Allocation: 	1061789


java -javaagent:lib/allocation.jar -jar target/bench2.9.2.jar  1 1	 

Sieve of Sundaram
___________________________

Cold results: 
	Average: 	6280.500000ms
	Median: 	6510ms
	Mode: 		6051ms
	Allocation: 	39809032

Warm results: 
	Average: 	5591.500000ms
	Median: 	5615ms
	Mode: 		5568ms
	Allocation: 	40779511


Sieve of Eratosthenes
_______________________________

Cold results: 
	Average: 	4537.000000ms
	Median: 	4608ms
	Mode: 		4466ms
	Allocation: 	28596804

Warm results: 
	Average: 	4332.500000ms
	Median: 	4336ms
	Mode: 		4329ms
	Allocation: 	28596971

2.10.0-rc3-benchmark's People

Contributors

csenol avatar markehammons 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.