Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
18 lines (13 sloc) 455 Bytes
require 'krypt'
require_relative 'resources'
require 'stringio'
require 'openssl'
require 'benchmark'
Benchmark.bm do |bm|
cert = Resources.certificate
[1000, 10_000, 100_000].each do |n|
bm.report("Krypt::X509.parse_der String(n=#{n})") { n.times { Krypt::X509::Certificate.parse_der(cert) } }
bm.report("OpenSSL::X509::Certificate String(n=#{n})") { n.times { OpenSSL::X509::Certificate.new(Resources.certificate) } }
puts
end
end
Something went wrong with that request. Please try again.