Revision: 1034
Author: [email protected]
Date: Thu Jan 21 06:21:26 2010
Log: In pp_subcall_profiler(), a "longhand" check for "DB" produces terser object
code than a call to strcmp(). Also make the comparison with "_INIT" avoid a
strcmp().
http://code.google.com/p/perl-devel-nytprof/source/detail?r=1034

Modified:
 /trunk/NYTProf.xs

=======================================
--- /trunk/NYTProf.xs   Thu Jan 21 06:04:16 2010
+++ /trunk/NYTProf.xs   Thu Jan 21 06:21:26 2010
@@ -2538,12 +2538,17 @@

/* ignore our own DB::_INIT sub - only shows up with 5.8.9+ & 5.10.1+ */
     if (subr_entry->called_is_xs
-    && *subr_entry->called_subpkg_pv == 'D'
-    && strEQ(subr_entry->called_subpkg_pv,"DB")
-    && strEQ(SvPV_nolen(subr_entry->called_subnam_sv), "_INIT")
+    && subr_entry->called_subpkg_pv[0] == 'D'
+    && subr_entry->called_subpkg_pv[1] == 'B'
+    && subr_entry->called_subpkg_pv[2] == '\0'
     ) {
-        subr_entry->already_counted++;
-        goto skip_sub_profile;
+        STRLEN len;
+        char *p = SvPV(subr_entry->called_subnam_sv, len);
+
+        if(memEQs(p, len, "_INIT")) {
+            subr_entry->already_counted++;
+            goto skip_sub_profile;
+        }
     }
     /* catch profile_subs being turned off by disable_profile call */
     if (!profile_subs)
-- 
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