summaryrefslogtreecommitdiff
path: root/lib/benchmark.rb
AgeCommit message (Collapse)Author
2014-09-11lib/benchmark.rb: remove CLOCK_MONOTONIC_RAW supportnormal
In addition to being unaffected by _offset_ correction, CLOCK_MONOTONIC_RAW is also unaffected by _frequency_ correction, making it unsuitable for measuring real time on systems where the clock is always running too fast or slow. CLOCK_MONOTONIC (without _RAW) is the correct clock, as it is unaffected by _offset_ correction (due to human error or battery replacement), but still takes _frequency_ correction into account for clocks which consistently run too fast or slow. Thanks to Vít Ondruch for reporting the issue on ARM [Bug #10202] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-31* lib/benchmark.rb: Fix a syntax error.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-31benchmark.rb: Process::CLOCK_MONOTONIC_RAW may be unavailablenobu
* lib/benchmark.rb (BENCHMARK_CLOCK): Process::CLOCK_MONOTONIC_RAW is not supported on old linux. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-30benchmark.rb: prefer Process::CLOCK_MONOTONIC_RAWnobu
* lib/benchmark.rb (BENCHMARK_CLOCK): prefer Process::CLOCK_MONOTONIC_RAW if available to more accurate measure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-24lib/benchmark.rb (measure): reduce allocations as in r47260normal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-24lib/benchmark.rb: speedup by reducing allocationsnormal
* lib/benchmark.rb (module Benchmark): define BENCHMARK_CLOCK (realtime): use Process.clock_gettime(BENCHMARK_CLOCK) [Feature #10165] * test/benchmark/test_benchmark.rb (test_realtime_output): new test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-23* lib/benchmark.rb: split executable code into sample directory.hsbt
* sample/benchmark.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-20* lib/benchmark.rb: [DOC] grammar of Benchmark#bm [Bug #8888]zzak
Patch by Prathamesh Sonpatki git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-30* lib/benchmark.rb: Update Benchmark results on newer CPUzzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18* lib/benchmark.rb: Fix Benchmark.benchmark output with an emptynaruse
caption. patched by Benoit Daloze. [ruby-core:45719] [Bug #6610] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-08* lib/benchmark.rb: Updated formatting of Benchmark documentation fordrbrain
consistency. [ruby-trunk - Bug #6533] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-05* ext/pathname/lib/pathname.rb, ext/tk/lib/multi-tk.rb,ktsj
ext/tk/sample/demos-en/widget, lib/benchmark.rb, lib/irb/cmd/fork.rb, lib/mkmf.rb, lib/net/ftp.rb, lib/net/smtp.rb, lib/open3.rb, lib/pstore.rb, lib/rexml/element.rb, lib/rexml/light/node.rb, lib/rinda/tuplespace.rb, lib/rss/maker/base.rb, lib/rss/maker/entry.rb, lib/scanf.rb, lib/set.rb, lib/shell.rb, lib/shell/command-processor.rb, lib/shell/process-controller.rb, lib/shell/system-command.rb, lib/uri/common.rb: remove unused block arguments to avoid creating Proc objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-28* lib/benchmark.rb: merge eregon/benchmark.naruse
https://github.com/eregon/ruby/tree/benchmark patched by Benoit Daloze. [ruby-core:37593] [Bug #4940] * lib/benchmark (Benchmark#bmbm): bmbm should be consistent with bm for the return value. * test/benchmark: remove preemptive test instead of skipping I removed the preemptive test I wrote for Feature #4197. I'll add it back when the implementation will be able to satisfy it. * lib/benchmark (Benchmark#bmbm): remove useless explicit call, #format is an alias of #to_s test/benchmark: add a test for format of long time. * lib/benchmark: fix label width: always add 1 to ensure there is a space delimiter even with times over 100s When I asked for Feature #4197, I wanted to make delimiting spaces consistent for #bm and #bmbm. But with times over 100s, the output contains no space between the label and the first time (user). Now both ensure there is always a space, even if that means 3 spaces with times under 10s (because it is formatted as %10.6f) * test/benchmark: let labels be a constant lib/benchmark (Benchmark#realtime): avoid creating an unused Proc lib/benchmark (Benchmark#benchmark): use ensure clause to restore STDOUT.sync, as in #bmbm git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-16 * lib/benchmark.rb: Document Benchmark::Tms#memberwise. Patch bydrbrain
David Czarnecki. [Ruby 1.9 - Bug #4873] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-25 * lib/benchmark.rb: Restore nodoc for Benchmark::Job anddrbrain
Benchmark::Report. [Ruby 1.9 - Bug #4726] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-19* lib: revert r31635-r31638 and untabify with expand(1).nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-18 * lib/benchmark.rb: Fix indentation.drbrain
* lib/net/imap.rb: Fix indentation of regular expressions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-18 * lib: Convert tabs to spaces for ruby files perdrbrain
http://redmine.ruby-lang.org/projects/ruby/wiki/DeveloperHowto#coding-style Patch by Steve Klabnik [Ruby 1.9 - Bug #4730] Patch by Jason Dew [Ruby 1.9 - Feature #4718] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-18* lib: remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-17 * lib/benchmark.rb: Remove nodoc from Benchmark::Job anddrbrain
Benchmark::Report. Patch by Sandor Szücs. [Ruby 1.9 - Bug #4726] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-07 * lib/benchmark.rb (Benchmark#bmbm): use ensure clause instead ofnagachika
Object#tap to restore STDOUT.sync. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-31* lib/benchmark.rb: fix benchmarck to work with current ruby.naruse
patched by Benoit Daloze [ruby-core:33846] [ruby-dev:43143] merged from https://github.com/eregon/ruby/commits/benchmark * lib/benchmark (Report#width): update documentation * lib/benchmark: document the return value of #benchmark and the :list attribute in Report * lib/benchmark (Tms#format): rename variables, use String#% instead of Kernel.format * lib/benchmark: remove undocumented Benchmark::times (an alias of Process::times used twice) * lib/benchmark (#benchmark): use label_width for the caption * lib/benchmark (Tms#initialize): rename variables * lib/benchmark: allow title to not be a String and call #to_s * lib/benchmark (Benchmark#bm): return an Array of the times with the labels * lib/benchmark: correct output for Benchmark#bmbm (remove the extra space) * lib/benchmark: add a few tests for Benchmark::Tms output * lib/benchmark: improve style (enumerators, ljust, unused vars) * lib/benchmark: add spec about output and return value * lib/benchmark: improve basic style and consistency no parenthesis for print and use interpolation instead of printf * lib/benchmark: remove unnecessary conversions and variables * lib/benchmark: correct indentation * lib/benchmark: rename the FMTSTR constant and variable to FORMAT * lib/benchmark: remove useless exception * test/benchmark: remove unused variable warnings git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-08* lib/*.rb: Remove unused variable warnings.marcandre
Patch by Run Paint [ruby-core:30991] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-02* lib/benchmark.rb (Benchmark::Tms#add): fix NameError.kazu
[ruby-dev:40906] * test/benchmark/test_benchmark.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-06* {ext,lib,test}/**/*.rb: removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-11update rdoc [ruby-core:20407] #835gotoken
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-10* lib/benchmark.rb (Job::Benchmark#item): fix typo.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-02* lib/benchmark.rb (Benchmark::realtime): make Benchmark#realtimematz
a bit faster. a patch from Alexander Dymo <dymo@ukrpost.ua> in [ruby-core:15337]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-31* lib/benchmark.rb (Benchmark::Job::item): avoid modifying thenobu
argument unintentionally. [ruby-talk:253676] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-18* dln.c, io.c, pack.c, lib/benchmark.rb, lib/cgi.rb, lib/csv.rb,nobu
lib/date.rb, lib/ftools.rb, lib/getoptlong.rb, lib/logger.rb, lib/matrix.rb, lib/monitor.rb, lib/set.rb, lib/thwait.rb, lib/timeout.rb, lib/yaml.rb, lib/drb/drb.rb, lib/irb/workspace.rb, lib/net/ftp.rb, lib/net/http.rb, lib/net/imap.rb, lib/net/pop.rb, lib/net/telnet.rb, lib/racc/parser.rb, lib/rinda/rinda.rb, lib/rinda/tuplespace.rb, lib/shell/command-processor.rb, lib/soap/rpc/soaplet.rb, lib/test/unit/testcase.rb, lib/test/unit/testsuite.rb: typo fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-20Tidy benchmark.rb documentation a taddave
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-19Converted RD to RDoc (Lyle Johnson) and improved documentation.gsinclair
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-11* lib/benchmark.rb (Benchmark::bm): get rid of warning.nobu
[ruby-talk:69124] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-31* hash.c (env_reject_bang): untaint key string.matz
* hash.c (env_delete_m): execute block only if deleting key does not exist. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-29* instruby.rb, ext/extmk.rb, lib/benchmark.rb, lib/cgi.rb,akr
lib/debug.rb, lib/getoptlong.rb, lib/optparse.rb, lib/time.rb, lib/date/format.rb, lib/irb/ruby-lex.rb lib/uri/common.rb: revert escape for `-' in character class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-03-21* regex.c (re_compile_pattern): fix previous change.akr
* instruby.rb, ext/extmk.rb, ext/tk/lib/tk.rb, lib/benchmark.rb, lib/cgi.rb, lib/debug.rb, lib/getoptlong.rb, lib/jcode.rb, lib/optparse.rb, lib/time.rb, lib/date/format.rb, lib/irb/ruby-lex.rb: escape `[', `]', `-' in chracter class in regexp to avoid warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-25exiled historical RD inclusion, wrong [ruby-dev:19191]gotoken
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-04-24discarded unused parametergotoken
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-14* re.c (rb_reg_match): should clear $~ if operand is nil.matz
* re.c (rb_reg_match2): ditto. * configure: merge Jonathan Baker's large file support patch [ruby-talk:35316], with read_all patch in [ruby-talk:35470]. * eval.c (rb_f_abort): optional message argument that be printed on termination. [new] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e