From: Tony Arcieri Date: 2013-07-17T05:24:11+09:00 Subject: Re: Kernel.caller Performance Across Different Ruby Versions --047d7b3a875064d22504e1a6c2c4 Content-Type: text/plain; charset=ISO-8859-1 Kernel.caller is very expensive on JRuby too, much more so than MRI. I'm curious why you're benchmarking it in the first place. `caller' is not something you want to be calling very often On Tue, Jul 16, 2013 at 10:40 AM, Peter Giacomo Lombardo < lists@ruby-forum.com> wrote: > I wrote a quick Ruby script to benchmark Kernel.caller using ruby-prof. > I then ran that script manually across 3 Ruby versions. > > The results indicate that Kernel.caller is incrementally slower in newer > Ruby versions. > > This seems counter-intuitive to me so what am I missing? Is there > something wrong in the way I'm benchmarking Kernel.caller or the test > script itself? > > The test script with ruby-prof output is available here: > https://gist.github.com/pglombardo/5978849 > > A couple notes: > > * For each Ruby version, I ran the test suite 5 times and pasted the > fastest output in the gist (based on total time) > * Ruby versions were standard "out of the box" as installed by rbenv > * The three Ruby versions were: 1.8.7-p374, 1.9.3-p448, 2.0.0-p247 > > Test Summary: > > Kernel.caller Total Times across Ruby Versions > (Each test makes 500 Kernel.caller calls with 1508 frames) > > Ruby 1.8.7-p374: 0.369ms > Ruby 1.9.3p448 : 0.462ms > Ruby 2.0.0-p247: 0.769ms > > Any input/guidance would be appreciated. Thanks! > Peter Giacomo Lombardo > > -- > Posted via http://www.ruby-forum.com/. > > -- Tony Arcieri --047d7b3a875064d22504e1a6c2c4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Kernel.caller is very expensive on JRuby too, much more so= than MRI.

I'm curious why you're benchmarking i= t in the first place. `caller' is not something you want to be calling = very often


On Tue,= Jul 16, 2013 at 10:40 AM, Peter Giacomo Lombardo <lists@ruby-forum.com= > wrote:
I wrote a quick Ruby script to benchmark Ker= nel.caller using ruby-prof.
I then ran that script manually across 3 Ruby versions.

The results indicate that Kernel.caller is incrementally slower in newer Ruby versions.

This seems counter-intuitive to me so what am I missing? =A0Is there
something wrong in the way I'm benchmarking Kernel.caller or the test script itself?

The test script with ruby-prof output is available here:
ht= tps://gist.github.com/pglombardo/5978849

A couple notes:

* For each Ruby version, I ran the test suite 5 times and pasted the
fastest output in the gist (based on total time)
* Ruby versions were standard "out of the box" as installed by rb= env
* The three Ruby versions were: 1.8.7-p374, 1.9.3-p448, 2.0.0-p247

Test Summary:

Kernel.caller Total Times across Ruby Versions
(Each test makes 500 Kernel.caller calls with 1508 frames)

Ruby 1.8.7-p374: 0.369ms
Ruby 1.9.3p448 : 0.462ms
Ruby 2.0.0-p247: 0.769ms

Any input/guidance would be appreciated. =A0Thanks!
Peter Giacomo Lombardo

--
Posted via http://= www.ruby-forum.com/.




-- Tony Arcieri
--047d7b3a875064d22504e1a6c2c4--