Sha256: 2c88d944f47ade9c1702918b016772578b8a96c9117b6c9f4e8c4252c1d98c98

Contents?: true

Size: 892 Bytes

Versions: 3

Compression:

Stored size: 892 Bytes

Contents

#
# a bit of benchmark
#
# Thu Nov  8 21:48:20 JST 2007
#

require 'benchmark'

require 'openwfe/def'
#require 'openwfe/engine/engine'
require 'openwfe/engine/file_persisted_engine'


class ProgDef < OpenWFE::ProcessDefinition
    sequence do
        toto
        toto
        toto
        toto
        toto
    end
end

xml = <<END
<process-definition name="x" revision="y">
    <sequence>
        <toto/>
        <toto/>
        <toto/>
        <toto/>
        <toto/>
    </sequence>
</process-definition>
END

#$engine = OpenWFE::Engine.new
$engine = OpenWFE::FilePersistedEngine.new

$engine.register_participant "toto" do |workitem|
    # do nothing
end

N = 500

def test (proc_def)
    N.times do 
        fei = $engine.launch proc_def
        $engine.wait_for fei
    end
end

Benchmark.bm do |x|
    x.report("prog :") { test ProgDef }
    x.report("xml :") { test xml.strip }
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
openwferu-0.9.16 test/bm/bm_1_xml_vs_prog.rb
openwferu-0.9.17 test/bm/bm_1_xml_vs_prog.rb
ruote-0.9.18 test/bm/bm_1_xml_vs_prog.rb