Proper benchmark #10

wants to merge 2 commits into


None yet
2 participants

judofyr commented Apr 20, 2011

Two commits:

Use benchmark.rb

There's a reason we have benchmark.rb in stdlib. This commit simply uses the Benchmark#bmbm method which ensures that the garbage collector doesn't affect the code unfairly (e.g. one benchmark allocates lots of objects, but they're collected in the next benchmark).

Compare against Erubis

It seems to me that you're aiming for some super fast template engine, so I think it's fair to compare it with Erubis. This includes a commit that shows that Erubis is 5-10 times faster than Nolate when caching the template (which is the common case for all frameworks in Ruby).

judofyr added some commits Apr 20, 2011

Switch to Benchmark.bmbm in benchmarks:
This ensures that the garbage collector doesn't
affect the benchmarks unfairly.

nono commented Apr 20, 2011

For your information, I've also seen that Erubis is faster than nolate on a real example. Slide-em-up used with these slides took more than 3s with nolate and 1.6s with erubis (the template is used only one time, so no caching is possible).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment