]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
tweaks
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 2 Aug 2013 22:29:25 +0000 (18:29 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 2 Aug 2013 22:29:25 +0000 (18:29 -0400)
test/perf/orm2010.py

index 4f36551c02092e36f4fe1ce8e30b276b7bc797d1..088563e946d4bfa9f133527a74fea2afcdf0995c 100644 (file)
@@ -62,9 +62,7 @@ Base.metadata.create_all(engine)
 
 sess = Session(engine)
 
-factor = 10
-
-def runit(status):
+def runit(status, factor=1):
     num_bosses = 100 * factor
     num_grunts = num_bosses * 100
 
@@ -126,7 +124,6 @@ def runit(status):
 
 def run_with_profile():
     import cProfile
-    import os
     import pstats
     filename = "orm2010.profile"
 
@@ -150,7 +147,7 @@ def run_with_profile():
 
     #stats.sort_stats('time', 'calls')
     #stats.print_stats()
-    os.system("runsnake %s" % filename)
+    #os.system("runsnake %s" % filename)
 
     # SQLA Version: 0.7b1
     # Total calls 4956750
@@ -174,7 +171,7 @@ def run_with_time():
     def status(msg):
         print("%d - %s" % (time.time() - now, msg))
 
-    runit(status)
+    runit(status, 10)
     print("Total time: %d" % (time.time() - now))
 
 run_with_time()