I have been using the Ruby PCAP module to implement a simple network
flow meter based on the RTFM architecture. When I run my meter with the
profiler option, I have discovered that the biggest single chunk of
time goes to calls to the “each” function of the Range class, with calls
this method accounting for up to 23% of total processing time when the
reads traffic data off trace files. This figure is approximately halved
the meter reads traffic off a live interface. I have checked my code, as
as the pcap_misc.rb and pcaplet.rb files within the Ruby PCAP module and
not sure where these calls are being made. I was wondering if anyone
with the Ruby PCAP module could inform me where the call to Range.each
I am now in the process of trying to improve my meter’s performance.
for your time.