Sha256: 9691f31890bc8a92777bd2bf5d706604b5602967fa2c8b938cd1f2c0595dbf27

Contents?: true

Size: 891 Bytes

Versions: 1

Compression:

Stored size: 891 Bytes

Contents

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

require 'benchmark'

require 'rubygems'

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(
  :definition_in_launchitem_allowed => true)

$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

1 entries across 1 versions & 1 rubygems

Version Path
ruote-0.9.19 test/bm/bm_1_xml_vs_prog.rb