My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads
Wiki pages
Links

GBench is a benchmarking framework for Groovy. GBench has two features for benchmarking: @Benchmark / Benchmark AST Transformation for real program benchmarking and BenchmarkBuilder for micro-benchmarking.

import gbench.*

class Task {
    @Benchmark void run() {
        // task
    }
}

/* Output:
Task  void run()  user:847000 system:1777000 cpu:2624000 real:4918000
*/
import gbench.*

new BenchmarkBuilder().run {
    'StringBuilder' {
	def sb = new StringBuilder()        
	sb.append('foo')
        sb.append('bar')
        sb.append('baz')
	sb.toString()
    }
    'StringBuffer' {
	def sb = new StringBuffer()        
	sb.append('foo')
	sb.append('bar')
	sb.append('baz')
	sb.toString()
    }
}.prettyPrint()

/* Output:
Environment
===========
* Groovy: 1.8.6
* JVM: Java HotSpot(TM) 64-Bit Server VM (23.0-b15, Oracle Corporation)
    * JRE: 1.7.0_04-ea
    * Total Memory: 99.4375 MB
    * Maximum Memory: 1169.8125 MB
* OS: Mac OS X (10.7.3, amd64) 

Options
=======
* Warm Up: Auto 
* CPU Time Measurement: On

	       user  system  cpu  real

StringBuilder   236       0  236   237
StringBuffer    263       0  263   267
*/

News

  • 2012-03-17 GBench 0.3.0 released / Source code repository moved to Git
  • 2011-09-09 GBench 0.2.2 released
  • 2011-09-09 GBench 0.2.1 eleased
  • 2011-07-20 GBench 0.2.0 released
Powered by Google Project Hosting