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.10.3-java benchmarks/id_generation.rb
instana-1.10.3 benchmarks/id_generation.rb
instana-1.10.2-java benchmarks/id_generation.rb
instana-1.10.2 benchmarks/id_generation.rb
instana-1.10.1-java benchmarks/id_generation.rb
instana-1.10.1 benchmarks/id_generation.rb
instana-1.10.0 benchmarks/id_generation.rb
instana-1.10.0.slimfast benchmarks/id_generation.rb
instana-1.9.7 benchmarks/id_generation.rb
instana-1.9.6 benchmarks/id_generation.rb
instana-1.9.5 benchmarks/id_generation.rb
instana-1.9.4 benchmarks/id_generation.rb
instana-1.9.3 benchmarks/id_generation.rb
instana-1.9.2 benchmarks/id_generation.rb
instana-1.9.1 benchmarks/id_generation.rb
instana-1.9.0 benchmarks/id_generation.rb
instana-1.9.0.daftrabbit benchmarks/id_generation.rb
instana-1.8.3 benchmarks/id_generation.rb
instana-1.9.0.sillyrabbit benchmarks/id_generation.rb
instana-1.8.2 benchmarks/id_generation.rb