So far, so good.
But when I try to profile this script, it runs for ages:
tim@zaphod:~/ruby$ time ruby -r profile test1.rb
% cumulative self self total
time seconds seconds calls ms/call ms/call name
39.60 395.46 395.46 77090 5.13 17.16 Array#each
…
real 18m37.780s
user 16m38.740s
sys 0m6.580s
Now I realise that the profiler must have some overhead, but this is
ridiculous - it’s taking 50 times longer! I’ve run similar scripts through
the profiler before, and I’ve never seen an increase like this. Any ideas?
So far, so good.
But when I try to profile this script, it runs for ages:
tim@zaphod:~/ruby$ time ruby -r profile test1.rb
% cumulative self self total
time seconds seconds calls ms/call ms/call name
39.60 395.46 395.46 77090 5.13 17.16 Array#each
…
real 18m37.780s
user 16m38.740s
sys 0m6.580s
Now I realise that the profiler must have some overhead, but this is
ridiculous - it’s taking 50 times longer! I’ve run similar scripts through
the profiler before, and I’ve never seen an increase like this. Any ideas?
So far, so good.
But when I try to profile this script, it runs for ages:
tim@zaphod:~/ruby$ time ruby -r profile test1.rb
% cumulative self self total
time seconds seconds calls ms/call ms/call name
39.60 395.46 395.46 77090 5.13 17.16 Array#each
…
real 18m37.780s
user 16m38.740s
sys 0m6.580s
Now I realise that the profiler must have some overhead, but this is
ridiculous - it’s taking 50 times longer! I’ve run similar scripts
through
the profiler before, and I’ve never seen an increase like this. Any
ideas?
The profiler overhead increases with increased number of invocations of
small methods. Array#each seems to be called quite often, so this might
be the reason for the overhead.