aboutsummaryrefslogtreecommitdiffstats
path: root/test/benchmark
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Ruby can delay arbitrarily because Ruby is not a realtime system, akr2014-09-021-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_benchmark.rb: use assert_in_epsilonnobu2014-08-311-1/+1
| | | | | | | | * test/benchmark/test_benchmark.rb (test_realtime_output): use assert_in_epsilon which compares in relative range, instead of assert_in_delta which compares in absolute range. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_benchmark.rb: extend sleep timenobu2014-08-301-2/+3
| | | | | | | * test/benchmark/test_benchmark.rb: extend sleep time, as 1ms is too short on some environments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/benchmark.rb: speedup by reducing allocationsnormal2014-08-241-0/+5
| | | | | | | | | | * 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
* * test/benchmark/test_benchmark.rb: Use test/unit.akr2014-05-241-72/+58
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/benchmark.rb: Fix Benchmark.benchmark output with an emptynaruse2012-07-181-48/+54
| | | | | | 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: merge eregon/benchmark.naruse2011-06-281-41/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* * test/benchmark/test_benchmark.rb (capture_output):naruse2011-06-121-1/+1
| | | | | | | | replace '-' as space. On NetBSD, subtract between two Process.times after and before the short process may return negative value like: t0=Process.times; yield; t1=Process.times; p t1.utime-t0.utime git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/benchmark/test_benchmark.rb (#capture_bench_output):kosaki2011-02-011-1/+1
| | | | | | | | | | Added explict sleep. Windows have imprecise time support. Thus Tms.new.Add!{} may be or may be not equal 0. The test failure started since r30747. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/benchmark.rb: fix benchmarck to work with current ruby.naruse2011-01-311-6/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/benchmark.rb (Benchmark::Tms#add): fix NameError.kazu2010-04-021-0/+10
[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