On Jun 10, 3:34=A0pm, Jan Friedrich <janfri.rubyfo... / gmail.com> wrote:
> Bench version 1.0.0 released!http://bench.rubyforge.org
>
> =3D=3D DESCRIPTION
>
> Do you remeber how to use the benchmark library from the Ruby standard
> lib? I don't.
>
> Now you need not to remember, there is Bench: A DSL around the benchmark
> lib of the Ruby
> standard lib with the goal to make benchmarking as easy as possible.
>
> =3D=3D SYNOPSIS
>
> Adapted example of the benchmark documentation from the pickaxe version 2
> page 657
>
> =A0 require 'bench'
>
> =A0 string =3D 'Stormy Weather'
> =A0 m =3D string.method(:length)
>
> =A0 benchmark 'code' do
> =A0 =A0 m.call
> =A0 end
>
> =A0 benchmark 'send' do
> =A0 =A0 string.send(:length)
> =A0 end
>
> =A0 benchmark 'eval' do
> =A0 =A0 eval "string.length"
> =A0 end
>
> =A0 run 10_000

What is the underlying translation of benchmark? I.e. the original
Benchmark library has a few different methods, which did you use? I
like the simplicity of your DSL. In the long run it might be nice to
see this advance beyond a dependency on the original benchmark
library.

T.