Last active
August 29, 2015 14:03
-
-
Save RomainFranceschini/6ee524638f97f3fe1449 to your computer and use it in GitHub Desktop.
DEVStone benchmark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To run this benchmark | |
# $ git clone https://github.com/devs-ruby/devs . | |
# $ gem build devs.gemspec && gem install devs-0.5.1.gem | |
# $ gem install devs-models | |
# $ git clone https://github.com/devs-ruby/devstone . | |
# $ gem build devs.gemspec && gem install devstone-0.0.1.gem | |
require 'devstone' | |
opt_base = { | |
internal_transition_time: 0, | |
external_transition_time: 0, | |
type: :hi, | |
maintain_hierarchy: true | |
} | |
disable_gc = false | |
iteration = 1 | |
widths = (50..2000).step(50).to_a | |
depths = [3] | |
puts "width - init time - simulation time" | |
widths.each do |width| | |
depths.each do |depth| | |
iteration.times do |i| | |
GC.disable if disable_gc | |
simulation = DEVStone.generate_and_simulate(:pdevs, opt_base.merge({depth: depth, width: width})) | |
puts "#{width} #{simulation.build_elapsed_secs.round(6)} #{simulation.elapsed_secs.round(6)}" | |
GC.enable if disable_gc | |
GC.start | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment