aboutsummaryrefslogtreecommitdiffstats
path: root/lib/benchmark.rb
Commit message (Collapse)AuthorAgeFilesLines
* lib/benchmark.rb: Specify frozen_string_literal: true.kazu2017-01-031-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [DOC] Fix typosa_matsuda2015-12-231-1/+1
| | | | | | | | | | | | | | | | | * benchmark.rb * getoptlong.rb * irb.rb * net/http.rb * net/http/header.rb * net/imap.rb * optparse.rb * pstore.rb * webrick.rb * xmlrpc.rb [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/benchmark.rb: just use Process::CLOCK_MONOTONICnormal2015-06-021-13/+4
| | | | | | | | | | | Assume Process::CLOCK_MONOTONIC exists (possibly emulated) and there is no need to bloat our code by defining a compatibility constant. * lib/benchmark.rb: just use Process::CLOCK_MONOTONIC [ruby-core:69390] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/benchmark.rb: Update Benchmark documentation and formatting.hsbt2015-05-191-6/+19
| | | | | | [fix GH-903][ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/benchmark.rb: remove CLOCK_MONOTONIC_RAW supportnormal2014-09-111-3/+0
| | | | | | | | | | | | | | | | 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
* * lib/benchmark.rb: Fix a syntax error.akr2014-08-311-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* benchmark.rb: Process::CLOCK_MONOTONIC_RAW may be unavailablenobu2014-08-311-1/+2
| | | | | | | * 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
* benchmark.rb: prefer Process::CLOCK_MONOTONIC_RAWnobu2014-08-301-1/+4
| | | | | | | * 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
* lib/benchmark.rb (measure): reduce allocations as in r47260normal2014-08-241-10/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/benchmark.rb: speedup by reducing allocationsnormal2014-08-241-2/+10
| | | | | | | | | | * 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
* * lib/benchmark.rb: split executable code into sample directory.hsbt2014-07-231-20/+0
| | | | | | * sample/benchmark.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/benchmark.rb: [DOC] grammar of Benchmark#bm [Bug #8888]zzak2013-09-201-1/+1
| | | | | | | Patch by Prathamesh Sonpatki git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/benchmark.rb: Update Benchmark results on newer CPUzzak2013-04-301-40/+38
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/benchmark.rb: Fix Benchmark.benchmark output with an emptynaruse2012-07-181-10/+10
| | | | | | 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
* * lib/benchmark.rb: Updated formatting of Benchmark documentation fordrbrain2012-06-081-25/+26
| | | | | | | consistency. [ruby-trunk - Bug #6533] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/pathname/lib/pathname.rb, ext/tk/lib/multi-tk.rb,ktsj2011-11-051-1/+1
| | | | | | | | | | | | | 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
* * lib/benchmark.rb: merge eregon/benchmark.naruse2011-06-281-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* * lib/benchmark.rb: Document Benchmark::Tms#memberwise. Patch bydrbrain2011-06-161-4/+11
| | | | | | | David Czarnecki. [Ruby 1.9 - Bug #4873] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/benchmark.rb: Restore nodoc for Benchmark::Job anddrbrain2011-05-251-2/+2
| | | | | | | Benchmark::Report. [Ruby 1.9 - Bug #4726] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib: revert r31635-r31638 and untabify with expand(1).nobu2011-05-191-9/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/benchmark.rb: Fix indentation.drbrain2011-05-181-3/+3
| | | | | | | * 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
* * lib: Convert tabs to spaces for ruby files perdrbrain2011-05-181-12/+12
| | | | | | | | | 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
* * lib: remove trailing spaces.nobu2011-05-181-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/benchmark.rb: Remove nodoc from Benchmark::Job anddrbrain2011-05-171-2/+6
| | | | | | | 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
* * lib/benchmark.rb (Benchmark#bmbm): use ensure clause instead ofnagachika2011-02-071-2/+2
| | | | | | Object#tap to restore STDOUT.sync. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/benchmark.rb: fix benchmarck to work with current ruby.naruse2011-01-311-87/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* * lib/*.rb: Remove unused variable warnings.marcandre2010-11-081-6/+6
| | | | | | Patch by Run Paint [ruby-core:30991] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/benchmark.rb (Benchmark::Tms#add): fix NameError.kazu2010-04-021-1/+1
| | | | | | | | [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
* * {ext,lib,test}/**/*.rb: removed trailing spaces.nobu2009-03-061-82/+82
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update rdoc [ruby-core:20407] #835gotoken2009-02-111-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/benchmark.rb (Job::Benchmark#item): fix typo.naruse2008-02-101-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/benchmark.rb (Benchmark::realtime): make Benchmark#realtimematz2008-02-021-1/+4
| | | | | | | 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
* * lib/benchmark.rb (Benchmark::Job::item): avoid modifying thenobu2007-05-311-1/+1
| | | | | | | argument unintentionally. [ruby-talk:253676] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c, io.c, pack.c, lib/benchmark.rb, lib/cgi.rb, lib/csv.rb,nobu2004-04-181-7/+7
| | | | | | | | | | | | | | 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
* Tidy benchmark.rb documentation a taddave2004-01-201-90/+55
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Converted RD to RDoc (Lyle Johnson) and improved documentation.gsinclair2003-09-191-460/+423
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/benchmark.rb (Benchmark::bm): get rid of warning.nobu2003-04-111-1/+1
| | | | | | | [ruby-talk:69124] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (env_reject_bang): untaint key string.matz2003-03-311-3/+3
| | | | | | | | * 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
* * instruby.rb, ext/extmk.rb, lib/benchmark.rb, lib/cgi.rb,akr2003-03-291-7/+7
| | | | | | | | | 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
* * regex.c (re_compile_pattern): fix previous change.akr2003-03-211-7/+7
| | | | | | | | | | | * 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
* exiled historical RD inclusion, wrong [ruby-dev:19191]gotoken2002-12-251-13/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* discarded unused parametergotoken2002-04-241-3/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_match): should clear $~ if operand is nil.matz2002-03-141-0/+651
* 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