[Python-checkins] r75694 - sandbox/trunk/ccbench/ccbench.py

antoine.pitrou python-checkins at python.org
Sun Oct 25 19:12:43 CET 2009


Author: antoine.pitrou
Date: Sun Oct 25 19:12:43 2009
New Revision: 75694

Log:
Add an option to set the switching interval (for newgil)



Modified:
   sandbox/trunk/ccbench/ccbench.py

Modified: sandbox/trunk/ccbench/ccbench.py
==============================================================================
--- sandbox/trunk/ccbench/ccbench.py	(original)
+++ sandbox/trunk/ccbench/ccbench.py	Sun Oct 25 19:12:43 2009
@@ -402,8 +402,11 @@
                       action="store_true", dest="latency", default=False,
                       help="run latency tests")
     parser.add_option("-i", "--interval",
-                      action="store", type="int", dest="interval", default=None,
+                      action="store", type="int", dest="check_interval", default=None,
                       help="sys.setcheckinterval() value")
+    parser.add_option("-I", "--switch-interval",
+                      action="store", type="float", dest="switch_interval", default=None,
+                      help="sys.setswitchinterval() value")
     parser.add_option("-n", "--num-threads",
                       action="store", type="int", dest="nthreads", default=4,
                       help="max number of threads in tests")
@@ -424,8 +427,10 @@
 
     if not options.throughput and not options.latency:
         options.throughput = options.latency = True
-    if options.interval:
-        sys.setcheckinterval(options.interval)
+    if options.check_interval:
+        sys.setcheckinterval(options.check_interval)
+    if options.switch_interval:
+        sys.setswitchinterval(options.switch_interval)
 
     print("== %s %s (%s) ==" % (
         platform.python_implementation(),


More information about the Python-checkins mailing list