test/bm/bm_2_step.rb in ruote-0.9.18 vs test/bm/bm_2_step.rb in ruote-0.9.19
- old
+ new
@@ -13,97 +13,97 @@
require 'flowtestbase'
class FlowTestRecursion < Test::Unit::TestCase
- include FlowTestBase
+ include FlowTestBase
- #def teardown
- #end
+ #def teardown
+ #end
- #def setup
- #end
+ #def setup
+ #end
- #
- # test 0
- #
+ #
+ # test 0
+ #
- #N = 500
- N = 100
+ #N = 500
+ N = 100
- #
- # Test0, N=100
- #
- # Tue May 13 17:24:53 JST 2008
- #
- # without substitution :
- # q : 2.72s
- # p : 752s
- #
- # with substitution :
- # q : 2.67s
- # p : 715s
- # (c : 10s)
- #
- # => :(
- #
- # with substitution : stack grows to 515 exps
- # without : stack grows to 615 exps
- #
+ #
+ # Test0, N=100
+ #
+ # Tue May 13 17:24:53 JST 2008
+ #
+ # without substitution :
+ # q : 2.72s
+ # p : 752s
+ #
+ # with substitution :
+ # q : 2.67s
+ # p : 715s
+ # (c : 10s)
+ #
+ # => :(
+ #
+ # with substitution : stack grows to 515 exps
+ # without : stack grows to 615 exps
+ #
- #
- # chaining N steps
- #
- # (took 39 seconds the first time for N = 500)
- #
- class Test0 < OpenWFE::ProcessDefinition
+ #
+ # chaining N steps
+ #
+ # (took 39 seconds the first time for N = 500)
+ #
+ class Test0 < OpenWFE::ProcessDefinition
- step0
+ step0
- (0..N).each do |i|
- define "stage#{i}" do
- sequence do
- _print "stage#{i}"
- set :f => 'outcome', :val => "step#{i+1}"
- #_print "${r:fexp.get_expression_storage.size}" if i == N
- end
- end
- define "step#{i}" do
- step "stage#{i}"
- end
+ (0..N).each do |i|
+ define "stage#{i}" do
+ sequence do
+ _print "stage#{i}"
+ set :f => 'outcome', :val => "step#{i+1}"
+ #_print "${r:fexp.get_expression_storage.size}" if i == N
end
+ end
+ define "step#{i}" do
+ step "stage#{i}"
+ end
+ end
- define "step#{N+1}" do
- _print "over."
- end
+ define "step#{N+1}" do
+ _print "over."
end
+ end
- #
- # testing against a sequence of N subprocess calls
- #
- # (took 6 seconds the first time for N = 500)
- # (just chaining N 'print "stage#{i}"' takes 0.7 second)
- #
- class Test0b < OpenWFE::ProcessDefinition
+ #
+ # testing against a sequence of N subprocess calls
+ #
+ # (took 6 seconds the first time for N = 500)
+ # (just chaining N 'print "stage#{i}"' takes 0.7 second)
+ #
+ class Test0b < OpenWFE::ProcessDefinition
+ sequence do
+ (0..N).each do |i|
+ subprocess :ref => "stage#{i}"
+ end
+ _print "over."
+ end
+ (0..N).each do |i|
+ define "stage#{i}" do
sequence do
- (0..N).each do |i|
- subprocess :ref => "stage#{i}"
- end
- _print "over."
+ _print "stage#{i}"
end
- (0..N).each do |i|
- define "stage#{i}" do
- sequence do
- _print "stage#{i}"
- end
- end
- end
+ end
end
+ end
- def test_0
+ def test_0
- dotest Test0, (0..N).collect { |i| "stage#{i}" }.join("\n") + "\nover."
- #dotest Test0b, (0..N).collect { |i| "stage#{i}" }.join("\n") + "\nover."
- end
+ dotest Test0, (0..N).collect { |i| "stage#{i}" }.join("\n") + "\nover."
+ #dotest Test0b, (0..N).collect { |i| "stage#{i}" }.join("\n") + "\nover."
+ end
end