Hi,

Before D::N we used Benchmark::Timer and the code to use it still
remains and we never doubted it until today. We have a server which
accepts jobs, queues them, returns a job ID and then later executes
them - very heavily database intensive and using DBD::Oracle. The part
of the process we are looking at is the accepting a connection,
reading the request, decoding it, queuing it and returning a unique ID
for the job (at this point the job is not executed). Over the last few
months and using D::N (big thank you BTW) we have identified problems
and managed to speed things up a lot. By sheer chance today when
looking at D::N output I noticed is differs massively from B::T for a
particular sub. This sub is called ~600 times and B::T shows

GET REQUEST,600 trials of GET REQUEST (32.070s total), 53.450ms/trial

where GET_REQUEST is the tag for the _get_request sub, reporting 600
calls and 32.070s in total for all 600.

D::N on the other hand reports:

# spent 6.03s (107ms+5.92) within main::_get_request which was called
600 times, avg 10.1ms/call: # 600 times (107ms+5.92s) at line 1277,
avg 10.1ms/call

Initially I thought perhaps B::T was using a less accurate timer and
rounding up on 600 calls but I see from the Timer.pm it contains:

use Time::HiRes qw( gettimeofday tv_interval );

and this is Linux and I believe Timer::HiRes baulks if you attempt to
use gettimeofday if it is not available.

The _get_request sub has a B::T->start at the start of _get_request
and B::T->stop at each possible return point and in any case B::T
whinges if you call start again without a stop.

The _get_request sub is not that complex, it reads utf8 encoded data
from a socket and decodes the JSON data (with JSON::XS) it read - it
can get a bit more complex but in this run it did not and most of the
statements were not executed.

Where should I start looking to locate this discrepancy?

--~--~---------~--~----~------------~-------~--~----~
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.

Group hosted at:  http://groups.google.com/group/develnytprof-dev
Project hosted at:  http://perl-devel-nytprof.googlecode.com
CPAN distribution:  http://search.cpan.org/dist/Devel-NYTProf

To post, email:  [email protected]
To unsubscribe, email:  [email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to