Sha256: 4bdf03412cde76fcc415283a2b9d55719966ca42b14ef833a787574a6ccef5b0

Contents?: true

Size: 295 Bytes

Versions: 77

Compression:

Stored size: 295 Bytes

Contents

#!/usr/bin/env ruby
require "bundler"
Bundler.require(:default)

require "benchmark"

ID_RANGE = -2**63..2**63-1

Benchmark.bm do |x|
  x.report("generate_id raw    ")   { 1_000_000.times { rand(-2**63..2**63-1) } }
  x.report("with fixed range   ")   { 1_000_000.times { rand(ID_RANGE) } }
end

Version data entries

77 entries across 77 versions & 1 rubygems

Version Path
instana-1.193.4 benchmarks/id_generation.rb
instana-1.193.3 benchmarks/id_generation.rb
instana-1.193.3.pre1 benchmarks/id_generation.rb
instana-1.193.2 benchmarks/id_generation.rb
instana-1.192.1 benchmarks/id_generation.rb
instana-1.192.0 benchmarks/id_generation.rb
instana-1.13.0 benchmarks/id_generation.rb
instana-1.12.0 benchmarks/id_generation.rb
instana-1.11.8-java benchmarks/id_generation.rb
instana-1.11.8 benchmarks/id_generation.rb
instana-1.11.7 benchmarks/id_generation.rb
instana-1.11.6 benchmarks/id_generation.rb
instana-1.11.6-java benchmarks/id_generation.rb
instana-1.11.5 benchmarks/id_generation.rb
instana-1.11.5-java benchmarks/id_generation.rb
instana-1.11.4-java benchmarks/id_generation.rb
instana-1.11.4 benchmarks/id_generation.rb
instana-1.11.3-java benchmarks/id_generation.rb
instana-1.11.3 benchmarks/id_generation.rb
instana-1.11.2-java benchmarks/id_generation.rb