Project

General

Profile

Actions

Bug #18293

closed

Time.at in master branch was 25% slower then Ruby 3.0

Added by watson1978 (Shizuo Fujita) over 2 years ago. Updated over 2 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 3.1.0dev (2021-11-08T13:15:21Z master bd2674ad33) [arm64-darwin21]
[ruby-core:105967]

Description

Ruby 3.0.2 Ruby 3.1.0-dev result
Time.at 8.223M 6.190M 0.753x

Environment

  • MacBook Pro (14inch, 2021)
  • macOS 12.0
  • Apple M1 Max
  • Apple clang version 13.0.0 (clang-1300.0.29.3)

Ruby 3.1.0-dev

$ ruby -v time.rb
ruby 3.1.0dev (2021-11-08T13:15:21Z master bd2674ad33) [arm64-darwin21]
Warming up --------------------------------------
             Time.at   614.843k i/100ms
Calculating -------------------------------------
             Time.at      6.190M (± 0.3%) i/s -     31.357M in   5.065559s

Ruby 3.0.2

$ ruby -v time.rb
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [arm64-darwin21]
Warming up --------------------------------------
             Time.at   821.722k i/100ms
Calculating -------------------------------------
             Time.at      8.223M (± 0.6%) i/s -     41.908M in   5.096820s

Test code

require 'benchmark/ips'

Benchmark.ips do |x|
  x.report('Time.at') { Time.at(0) }
end

Files

patch.diff (2.52 KB) patch.diff k0kubun (Takashi Kokubun), 11/10/2021 04:23 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0