sandro / bench_press Goto Github PK
View Code? Open in Web Editor NEWAbandoned. simple ruby benchmarking
Home Page: http://rubybenchmark.com
License: MIT License
Abandoned. simple ruby benchmarking
Home Page: http://rubybenchmark.com
License: MIT License
I'm on Archlinux with Ruby 1.9.1.
After applying the patch in my fork: http://github.com/manveru/bench_press/commit/e0ff0dbbe752787cef5de6de2157f7f19bd4d578
I get this error when trying to publish.
Haven't digged much further, might be an issue with Facter instead.
/home/manveru/github/manveru/bench_press/lib/bench_press/system_information.rb:34:in `digest': can't convert nil into String (TypeError)
from /home/manveru/github/manveru/bench_press/lib/bench_press/system_information.rb:34:in `hexdigest'
from /home/manveru/github/manveru/bench_press/lib/bench_press/system_information.rb:34:in `crypted_identifier'
from /home/manveru/github/manveru/bench_press/lib/bench_press/report.rb:42:in `to_hash'
from /home/manveru/github/manveru/bench_press/lib/bench_press/ruby_benchmark.rb:9:in `publish'
from /home/manveru/github/manveru/bench_press/lib/bench_press/cli.rb:92:in `publish'
from /home/manveru/github/manveru/bench_press/lib/bench_press/cli.rb:68:in `perform_bench_press'
from /home/manveru/github/manveru/bench_press/lib/bench_press/cli.rb:55:in `run'
from /home/manveru/github/manveru/bench_press/bin/bench_press:4:in `<main>'
zsh: exit 1 ~/github/manveru/bench_press/bin/bench_press -p sum.rb
I like the web site! Newly found out about it. I think one important metric to skimming benchmarks is what version the interpreter is. I noticed the same test run twice on two different interps getting the opposite result:
Test August 2, 2010
"explicit return" is up to 35% faster over 100000 repetitions
Return August 2, 2010
"implicit return" is up to 12% faster over 100000 repetitions
This was a great start.
Have you thought of allowing people to submit their benchmark scripts?
And providing a service that records different results?
Maybe store something like:
github or twitter id, date, environment, and result.
Environment could possibly be: machine specs, benchmark, operating system, ruby version, gem version (not sure about this)
Thanks,
Keenan
Hi, your current implementation of formatted_number
does not work for numbers less than 1000. For example:
formatted_number(999)
=> nil
I see that your implementation borrows heavily from Rails:
http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_with_delimiter
The problem? gsub!
can return nil if no substitutions are performed:
"Performs the substitutions of String#gsub in place, returning str, or nil if no substitutions were performed."
http://www.ruby-doc.org/core-1.9.3/String.html#method-i-gsub-21
The fix? Change your gsub!
to gsub
. Gotta love the one character fixes.
[13:20:13 miker@optisol-006 ~/optisol/src/rails/benchmarks] $ bench_press --publish tr_vs_gsub.rb
/usr/local/lib/ruby/gems/1.8/gems/bench_press-0.3.0/lib/bench_press/report.rb:59:in heading': undefined method
name' for nil:NilClass (NoMethodError)
from /usr/local/lib/ruby/gems/1.8/gems/bench_press-0.3.0/lib/bench_press/report.rb:63:in runnable_heading' from /usr/local/lib/ruby/gems/1.8/gems/bench_press-0.3.0/lib/bench_press/report.rb:20:in
to_s'
from /usr/local/lib/ruby/gems/1.8/gems/bench_press-0.3.0/lib/bench_press.rb:95:in puts' from /usr/local/lib/ruby/gems/1.8/gems/bench_press-0.3.0/lib/bench_press.rb:95 from /usr/local/bin/bench_press:19 /usr/local/lib/ruby/gems/1.8/gems/bench_press-0.3.0/lib/bench_press.rb:43:in
date': undefined method parse' for Time:Class (NoMethodError) from /usr/local/share/optisol/src/rails/benchmarks/tr_vs_gsub.rb:8 from /usr/local/lib/ruby/gems/1.8/gems/bench_press-0.3.0/lib/bench_press/cli.rb:77:in
load'
from /usr/local/lib/ruby/gems/1.8/gems/bench_press-0.3.0/lib/bench_press/cli.rb:77:in measurable' from /usr/local/lib/ruby/gems/1.8/gems/bench_press-0.3.0/lib/bench_press/cli.rb:66:in
perform_bench_press'
from /usr/local/lib/ruby/gems/1.8/gems/bench_press-0.3.0/lib/bench_press/cli.rb:55:in run' from /usr/local/lib/ruby/gems/1.8/gems/bench_press-0.3.0/bin/bench_press:4 from /usr/local/bin/bench_press:19:in
load'
from /usr/local/bin/bench_press:19
cli.rb, on line 89
if email && !email.nil?
Crash on ruby 1.9+
Using
if email && !email.nil?
Works good
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.