From: Yui NARUSE <redmine@...> Date: 2011-05-09T00:24:11+09:00 Subject: [ruby-core:36044] [Ruby 1.9 - Feature #4197][Assigned] Improvement of the benchmark library Issue #4197 has been updated by Yui NARUSE. Status changed from Closed to Assigned Assignee changed from Yui NARUSE to Benoit Daloze ---------------------------------------- Feature #4197: Improvement of the benchmark library http://redmine.ruby-lang.org/issues/4197 Author: Benoit Daloze Status: Assigned Priority: Normal Assignee: Benoit Daloze Category: lib Target version: 1.9.x =begin Hello Rubyists ! The Benchmark library's code is now becoming a bit old, and I would like to keep it up to date. http://redmine.ruby-lang.org/wiki/ruby/Maintainers says there is no maintainer for lib/benchmark. However, lib/benchmark.rb says it was created by Gotoken, and he made a commit on Feb 19, 2009. The library has not been touched from 2004 (2002 for the code base), except for minor fixes. I made several commits to clean the code, test it, watch it fail, and fix 2 minor bugs. The commits are small, so feel free to discuss them separately. You can see the commits here: https://github.com/eregon/ruby/commits/benchmark I did not modify the API, except Benchmark#benchmark's first parameter, which do not need anymore to be manually padded with spaces: Benchmark.benchmark(" "*7 + CAPTION, 7, ... become Benchmark.benchmark(CAPTION, 7, ... (and Benchmark#bm now returns an Array of Benchmark::Tms times instead of STDOUT.sync) I would like to improve Benchmark#bm, to not have to give the maximum label width, and let the library calculate it. This will be part of another Feature request, to focus on cleaning code in this one. This is my first direct contribution to Ruby, so please be indulgent. If you are interested in some context about myself, please see [ruby-core:33845] Merry Christmas ! Benoit Daloze =end -- http://redmine.ruby-lang.org