Sha256: dca75c71f4c5de709ee00a1099948dcdf0d0af864c9a3a1447b4c19ce9adc2be

Contents?: true

Size: 875 Bytes

Versions: 28

Compression:

Stored size: 875 Bytes

Contents

task :benchmark do
  require 'lib/uuidtools'
  require 'benchmark'

  # Version 1
  result = Benchmark.measure do
    10000.times do
      UUID.timestamp_create.to_s
    end
  end
  puts "#{(10000.0 / result.real)} version 1 per second."

  # Version 3
  result = Benchmark.measure do
    10000.times do
      UUID.md5_create(UUID_URL_NAMESPACE,
        "http://www.ietf.org/rfc/rfc4122.txt").to_s
    end
  end
  puts "#{(10000.0 / result.real)} version 3 per second."

  # Version 4
  result = Benchmark.measure do
    10000.times do
      UUID.random_create.to_s
    end
  end
  puts "#{(10000.0 / result.real)} version 4 per second."

  # Version 5
  result = Benchmark.measure do
    10000.times do
      UUID.sha1_create(UUID_URL_NAMESPACE,
        "http://www.ietf.org/rfc/rfc4122.txt").to_s
    end
  end
  puts "#{(10000.0 / result.real)} version 5 per second."
end

Version data entries

28 entries across 25 versions & 8 rubygems

Version Path
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/uuidtools-2.1.5/tasks/benchmark.rake
vagrant-cloudstack-1.2.0 vendor/bundle/gems/uuidtools-2.1.5/tasks/benchmark.rake
vagrant-cloudstack-1.1.0 vendor/bundle/gems/uuidtools-2.1.5/tasks/benchmark.rake
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/uuidtools-2.1.5/tasks/benchmark.rake
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/uuidtools-2.1.4/tasks/benchmark.rake
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/uuidtools-2.1.4/tasks/benchmark.rake
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/uuidtools-2.1.4/tasks/benchmark.rake
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/uuidtools-2.1.4/tasks/benchmark.rake
uuidtools-2.1.5 tasks/benchmark.rake
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/gems/uuidtools-2.1.4/tasks/benchmark.rake
uuidtools-2.1.4 tasks/benchmark.rake
uuidtools-2.1.3 tasks/benchmark.rake
radiant-1.0.0 ruby-debug/ruby/1.8/gems/uuidtools-2.1.2/tasks/benchmark.rake
sidekick-client-0.2.5 lib/ext/uuidtools-2.1.1/tasks/benchmark.rake
uuidtools-2.1.2 tasks/benchmark.rake
sidekick-client-0.2.4 lib/ext/uuidtools-2.1.1/tasks/benchmark.rake
sidekick-client-0.2.3 lib/ext/uuidtools-2.1.1/tasks/benchmark.rake
sidekick-client-0.2.2 lib/ext/uuidtools-2.1.1/tasks/benchmark.rake
sidekick-client-0.2.1 lib/ext/uuidtools-2.1.1/tasks/benchmark.rake
sidekick-client-0.2.0 lib/ext/uuidtools-2.1.1/tasks/benchmark.rake