diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-09-06 13:01:21 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-09-06 13:01:21 -0400 |
| commit | fa7c8f88113d2e769274dee4aa4247b9c9aadec8 (patch) | |
| tree | f3364e1816eefbabbb77c437ca0e401af6cea250 /examples/performance/single_inserts.py | |
| parent | d39daa43fe79c40419adf4babc5ae04f814461b7 (diff) | |
| download | sqlalchemy-fa7c8f88113d2e769274dee4aa4247b9c9aadec8.tar.gz | |
- try to finish up the performance example for now
Diffstat (limited to 'examples/performance/single_inserts.py')
| -rw-r--r-- | examples/performance/single_inserts.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/examples/performance/single_inserts.py b/examples/performance/single_inserts.py index 4178ccea8..cfce90300 100644 --- a/examples/performance/single_inserts.py +++ b/examples/performance/single_inserts.py @@ -21,6 +21,10 @@ class Customer(Base): description = Column(String(255)) +Profiler.init("single_inserts", num=10000) + + +@Profiler.setup def setup_database(dburl, echo, num): global engine engine = create_engine(dburl, echo=echo) @@ -106,16 +110,14 @@ def test_core_query_caching(n): @Profiler.profile def test_dbapi_raw_w_connect(n): - """Individual INSERT/COMMIT pairs using a pure DBAPI connection, - connect each time.""" + """Individual INSERT/COMMIT pairs w/ DBAPI + connection each time""" _test_dbapi_raw(n, True) @Profiler.profile def test_dbapi_raw_w_pool(n): - """Individual INSERT/COMMIT pairs using a pure DBAPI connection, - using a connection pool.""" + """Individual INSERT/COMMIT pairs w/ DBAPI + connection pool""" _test_dbapi_raw(n, False) @@ -161,4 +163,4 @@ def _test_dbapi_raw(n, connect): if __name__ == '__main__': - Profiler.main(setup=setup_database, num=10000) + Profiler.main() |
