Coder Social home page Coder Social logo

bench_press's People

Contributors

groxx avatar rbxbx avatar sandro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bench_press's Issues

formatted_number broken below 1000

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.

Add benchmark collaboration

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

Error when trying to run test

[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 methodname' 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:into_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:indate': 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:inload'
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:inperform_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:inload'
from /usr/local/bin/bench_press:19

Ruby Interp. Should be Identified on main page

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

Cannot publish

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.