cvs: ZendEngine2(PHP_5_3) / zend.c

[email protected] ("Derick Rethans")
Newsgroups php.zend-engine.cvs
Message-ID <cvsderick1201171332@cvsserver>
derick		Thu Jan 24 10:42:12 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /ZendEngine2	zend.c 
  Log:
  - MFH: Show GC statistics if GC benchmarking is enabled.
  #- Discussed this with Dmitry.
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend.c?r1=1.308.2.12.2.35.2.5&r2=1.308.2.12.2.35.2.6&diff_format=u
Index: ZendEngine2/zend.c
diff -u ZendEngine2/zend.c:1.308.2.12.2.35.2.5 ZendEngine2/zend.c:1.308.2.12.2.35.2.6
--- ZendEngine2/zend.c:1.308.2.12.2.35.2.5	Tue Jan 22 09:27:46 2008
+++ ZendEngine2/zend.c	Thu Jan 24 10:42:12 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend.c,v 1.308.2.12.2.35.2.5 2008/01/22 09:27:46 dmitry Exp $ */
+/* $Id: zend.c,v 1.308.2.12.2.35.2.6 2008/01/24 10:42:12 derick Exp $ */
 
 #include "zend.h"
 #include "zend_extensions.h"
@@ -891,6 +891,20 @@
 	}
 #endif
 
+#if GC_BENCH
+	printf("GC Statistics\n");
+	printf("-------------\n");
+	printf("Runs:               %d\n", GC_G(gc_runs));
+	printf("Collected:          %d\n", GC_G(collected));
+	printf("Root buffer length: %d\n", GC_G(root_buf_length));
+	printf("Root buffer peak:   %d\n\n", GC_G(root_buf_peak));
+	printf("      Possible            Remove from  Marked\n");
+	printf("        Root    Buffered     buffer     grey\n");
+	printf("      --------  --------  -----------  ------\n");
+	printf("ZVAL  %8d  %8d  %9d  %8d\n", GC_G(zval_possible_root), GC_G(zval_buffered), GC_G(zval_remove_from_buffer), GC_G(zval_marked_grey));
+	printf("ZOBJ  %8d  %8d  %9d  %8d\n", GC_G(zobj_possible_root), GC_G(zobj_buffered), GC_G(zobj_remove_from_buffer), GC_G(zobj_marked_grey));
+#endif
+
 	zend_try {
 		zend_ini_deactivate(TSRMLS_C);
 	} zend_end_try();
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.