-
Notifications
You must be signed in to change notification settings - Fork 27
Benchmarks
Benchmark 1
50 tries for each test
user system total real
assign ‘1’ rinruby 0.010000 0.000000 0.010000 ( 6.558104)
assign ‘1’ rserve 0.000000 0.000000 0.000000 ( 0.001662)
assign ‘1’ rsruby 0.000000 0.000000 0.000000 ( 0.000484)
assign double(30000) rinruby 2.420000 0.080000 2.500000 ( 9.009089)
assign double(30000) rserve 0.420000 0.010000 0.430000 ( 0.436437)
assign double(30000) rsruby 0.030000 0.000000 0.030000 ( 0.023931)
void_eval rinruby 0.030000 0.060000 0.090000 ( 2.153083)
void_eval rserve 0.000000 0.020000 0.020000 ( 1.992668)
void_eval rsruby 0.010000 0.000000 0.010000 ( 0.004093)
get ‘1’ rinruby 0.010000 0.000000 0.010000 ( 3.969531)
get ‘1’ rserve 0.010000 0.000000 0.010000 ( 2.000000)
get ‘1’ rsruby 0.000000 0.000000 0.000000 ( 0.000911)
get double(30000) rinruby 2.300000 0.070000 2.370000 ( 4.606750)
get double(30000) rserve 16.230000 0.080000 16.310000 ( 18.263280)
get double(30000) rsruby 0.000000 0.000000 0.000000 ( 0.000311)
Benchmark 2
100 – 4500 items, assign and retrieval
As you see, Rinruby is the the slowest in all test, except for retrieval on massive double data (~3000 on assign, ~2000 on retrieval)
RsRuby is the fastest of all, but the API requires careful attention.
Rserve is much faster than Rinruby, except when getting great amount of data from R.
So, if you have simple requirements, you need speed and you can use Ruby 1.8/1.9 on unix, use RsRuby.
For a simpler API, robust operation (on Unix), need to support multiple Ruby implementations and good speed, use Rserve.
For the simplest API, rock solid stability on Unix and Windows, need to support multiple Ruby implementations and lowest requirements, use RinRuby.
The problem with rserve on large amount of data is the overload of creating REXP object. RinRuby work directly with arrays, so is a lot faster. Maybe we could traslate directly R’s integer and double vector onto Ruby’s arrays , with modules WithAttributes and WithNames included. Other objects, as lists, should be processed using REXPs.