Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Performance note

kaorukobo edited this page · 4 revisions
Clone this wiki locally

Performance Note

The benchmark result on Intel Core Duo 2.1GHz.

Benchmark with empty method

It costs about 50 times. but it is not so helpful to measure the performance loss.

Ruby 1.8.7

Code: http://github.com/kaorukobo/rhook/blob/master/examples/benchmark_empty_method.rb

                              user     system      total        real
direct:                   0.020000   0.000000   0.020000 (  0.011719)
rhook enabled:            0.760000   0.000000   0.760000 (  0.777647)
rhook disabled:           0.660000   0.000000   0.660000 (  0.666535)

Ruby 1.9.2

                              user     system      total        real
direct:                   0.010000   0.000000   0.010000 (  0.008430)
rhook enabled:            0.400000   0.000000   0.400000 (  0.419464)
rhook disabled:           0.380000   0.010000   0.390000 (  0.380776)

Benchmark with logger's add method

Code: http://github.com/kaorukobo/rhook/blob/master/examples/benchmark_logger.rb

This is the case that the method has a certain level of script lines & I/O operation. It costs about 2 times. This result may be helpful in general cases.

Ruby 1.8.7

                              user     system      total        real
direct:                   0.880000   0.000000   0.880000 (  0.888195)
rhook enabled:            1.700000   0.010000   1.710000 (  1.717139)
rhook disabled:           1.620000   0.010000   1.630000 (  1.628115)

Ruby 1.9.2

                              user     system      total        real
direct:                   0.780000   0.010000   0.790000 (  0.795562)
rhook enabled:            1.320000   0.020000   1.340000 (  1.346731)
rhook disabled:           1.290000   0.010000   1.300000 (  1.330085)
Something went wrong with that request. Please try again.