About Me

My photo
Author of Groovy modules: GBench, GProf, Co-author of a Java book パーフェクトJava, Game Developer at GREE

Wednesday, July 20, 2011

GBench 0.2.0 released

I released GBench 0.2.0 today. GBench is a benchmarking framework for Groovy. This framework allows you to easily benchmark for Groovy programs by providing two powerful features, an AST transformation and a builder.


What's New
  • Added support for CPU time.
  • Improved the builder API.
    • Added better (Groovier) syntax to add benchmark target code blocks.
                ----
                run {
              with 'label', {
              }
          }
          ----
                ->
                ----
                run {
              label {
              }
          }
          ----
    • Added new options for run().
      • "average", "idle", "trim". See its javadoc for usage. Thanks to Yasuharu Nakano (author of GroovyServ) for providing the source code.
      • "repeat". This option is an alternative to "time" option, but "time" option still available for backward compatibility.
    • Added new APIs.
      • sum(), average(), prettyPrint(). See their javadoc for usage.
  • Changed versioning scheme.
        YY.MM.DD
        ->
        Major.Minor.Micro


Resolved Issues
  • The name of the system property to specify @Benchmark's default handling contains the old domain.
        "groovybenchmark.sf.net.defaulthandle"
        ->
        "gbench.defaulthandle"


Examples
  • AST transformation Example:

  • Builder Example:

Please try and let me know your feedback (via this blog's comment, the project's issue tracking system, or Twitter:@nagai_masato). Your feedback helps GBench to continue to impove.

2 comments:

  1. hi Nagai,

    I am trying to use Gbench 0.2.2 within a Grails application. I was wondering if you had any suggestions to ensure @Benchmark logs the execution time using log4J.

    Thanks

    ReplyDelete
  2. Hi, Yoann.

    You can use "gbench.defaulthandle" system property to realize the purpose like: -Dgbench.defaulthandle="org.apache.commons.logging.LogFactory.getLog('BM').info(klass + '.' + method + ':' + time.real)". I also explain about it in @Benchmark's javadoc. Thanks.

    ReplyDelete