From: Eric Wong Date: 2013-07-17T05:12:54+09:00 Subject: Re: Kernel.caller Performance Across Different Ruby Versions Peter Giacomo Lombardo 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? Optimizing data structures (to compact byte code) to speed up common operations, but makes uncommonly-accessed information (file names, line numbers) more expensive to access. I think it's a fair trade to make, caller should not be a frequently-called method. Btw, same idea applies to database design, creating indexes will speed up some operations at the expense of others.