Slide 36
Slide 36 text
SOAP vs.Rest
Brittany Martin @BrittJMartin
Benchmark.bmbm(100) do |x|
x.report("SOAP") { n.times do
Webservices::Requests::GetNewSessionKeyRequest.new({:ip =>
'0.0.0.0'}).invoke.session_key
end }
x.report("REST") { n.times do
Rest.new.create_session('0.0.0.0')['SessionKey']
end}
end
APIs called 100x each.
Benchmark::Tms:0x00007ff17de18270 @label="SOAP", @real=3.547331999987364,
@cstime=0.0, @cutime=0.0, @stime=0.09988699999999984, @utime=1.6087319999999998,
@total=1.7086189999999997
Benchmark::Tms:0x00007ff17f596f50 @label="REST", @real=26.420482000001357,
@cstime=0.0, @cutime=0.0, @stime=0.17270999999999992, @utime=1.5042220000000004,
@total=1.6769320000000003
SOAP real-time = 3.547331999987364
REST real-time = 26.420482000001357
SOAP is 8x faster.