Revision: 988
Author: tim.bunce
Date: Tue Dec 22 13:37:49 2009
Log: Added a DATA COLLECTION AND INTERPRETATION section to the docs.
Just covers "Calls from XSUBs and Opcodes" for now.

http://code.google.com/p/perl-devel-nytprof/source/detail?r=988

Modified:
  /trunk/lib/Devel/NYTProf.pm

=======================================
--- /trunk/lib/Devel/NYTProf.pm Tue Dec 22 11:21:57 2009
+++ /trunk/lib/Devel/NYTProf.pm Tue Dec 22 13:37:49 2009
@@ -556,6 +556,36 @@
  subroutine profile data, and then closes the file. The in memory subroutine
  profile data is then discarded.

+=head1 DATA COLLECTION AND INTERPRETATION
+
+NYTProf tries very hard to gather accurate information.  The nature of the
+internals of perl mean that, in some cases, the information that's  
gathered is
+accurate but surprising. In some cases it can appear to be misleading.
+(Of course, in some cases it may actually be plain wrong. Caveat lector.)
+
+=head2 Calls from XSUBs and Opcodes
+
+Calls record the current filename and line number of the perl code at the  
time
+the call was made. That's fine and accurate for calls from perl code. For  
calls
+that originate from C code however, such as an XSUB or an opcode, the  
filename and
+line number recorded are still those of the last I<perl> statement  
executed.
+
+For example, a line that calls an xsub will appear in reports to also have
+called any subroutines that the xsub called. This can be construed as a  
feature.
+
+As an extreme example, the first time a regular expression that uses  
character
+classes is executed on a unicode string you'll find profile data like this:
+
+      # spent 544µs within main::be...@4 which was called
+      #    once (544µs+0s) by main::CORE:subst at line 0
+  4   s/ (?: [A-Z] | [\d] )+ (?= [\s] ) //x;
+      # spent  38.8ms making 1 call to main::CORE:subst
+      # spent  25.4ms making 2 calls to utf8::SWASHNEW, avg 12.7ms/call
+      # spent  12.4ms making 1 call to utf8::AUTOLOAD
+
+=for comment
+No doubt more odd cases will be added here over time.
+
  =head1 REPORTS

  The L<Devel::NYTProf::Data> module provides a low-level interface for  
loading

-- 
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