Revision: 912
Author: tim.bunce
Date: Mon Nov 16 04:52:55 2009
Log: Tweak NYTP_FILE_LARGE_BUFFER_SIZE for minor optimization of zipping.

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

Modified:
  /trunk/Changes
  /trunk/NYTProf.xs

=======================================
--- /trunk/Changes      Mon Nov 16 03:47:10 2009
+++ /trunk/Changes      Mon Nov 16 04:52:55 2009
@@ -13,7 +13,6 @@
  XXX add "calls N subs" to treemap mouseover box
  XXX Should slowops that call other code appear in call tree?
  XXX test profiling code that has syntax errors
-XXX profile with larger sizes of large_buffer (ie x10 small buffer)

    Note: The file format has changed. Old files can't be read.

=======================================
--- /trunk/NYTProf.xs   Mon Nov 16 03:47:10 2009
+++ /trunk/NYTProf.xs   Mon Nov 16 04:52:55 2009
@@ -196,8 +196,15 @@
  #define NYTP_FILE_DEFLATE       1
  #define NYTP_FILE_INFLATE       2

+/* During profiling the large buffer collects the raw data until full.
+ * Then flush_output zips it into the small buffer and writes it to disk.
+ * A scale factor of ~90 makes the large buffer usually almost fill the  
small
+ * one when zipped (so calls to flush_output() almost always trigger one  
fwrite()).
+ * We use a lower number to save some memory as there's little performance
+ * impact either way.
+ */
  #define NYTP_FILE_SMALL_BUFFER_SIZE   4096
-#define NYTP_FILE_LARGE_BUFFER_SIZE   16384
+#define NYTP_FILE_LARGE_BUFFER_SIZE   (NYTP_FILE_SMALL_BUFFER_SIZE * 40)

  #ifdef HAS_ZLIB
  #  define FILE_STATE(f)         ((f)->state)

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