diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-03-08 15:32:21 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-03-08 15:32:21 -0400 |
| commit | a421106c9d1d660af7c5d9aba5928dda20c950e1 (patch) | |
| tree | 504426815dc61a86db8ea217a2c9f921fca03599 /examples | |
| parent | a92f6662b4e15d5924a686a46d1a6d9b7aa958d5 (diff) | |
| download | sqlalchemy-a421106c9d1d660af7c5d9aba5928dda20c950e1.tar.gz | |
- random performance whacking vs. 0.9, in particular we have to watch
for the slots-based __getattr__ thing getting hit
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/performance/__init__.py | 1 | ||||
| -rw-r--r-- | examples/performance/large_resultsets.py | 13 | ||||
| -rw-r--r-- | examples/performance/short_selects.py | 8 |
3 files changed, 12 insertions, 10 deletions
diff --git a/examples/performance/__init__.py b/examples/performance/__init__.py index a4edfce36..5a1aeeb70 100644 --- a/examples/performance/__init__.py +++ b/examples/performance/__init__.py @@ -298,6 +298,7 @@ class Profiler(object): pr.disable() stats = pstats.Stats(pr).sort_stats('cumulative') + #stats.print_callers() self.stats.append(TestResult(self, fn, stats=stats)) return result diff --git a/examples/performance/large_resultsets.py b/examples/performance/large_resultsets.py index fbe77c759..c13683040 100644 --- a/examples/performance/large_resultsets.py +++ b/examples/performance/large_resultsets.py @@ -42,12 +42,13 @@ def setup_database(dburl, echo, num): s = Session(engine) for chunk in range(0, num, 10000): - s.bulk_insert_mappings(Customer, [ - { - 'name': 'customer name %d' % i, - 'description': 'customer description %d' % i - } for i in range(chunk, chunk + 10000) - ]) + s.execute( + Customer.__table__.insert(), + params=[ + { + 'name': 'customer name %d' % i, + 'description': 'customer description %d' % i + } for i in range(chunk, chunk + 10000)]) s.commit() diff --git a/examples/performance/short_selects.py b/examples/performance/short_selects.py index d81dc0dbb..333fb9632 100644 --- a/examples/performance/short_selects.py +++ b/examples/performance/short_selects.py @@ -41,10 +41,10 @@ def setup_database(dburl, echo, num): sess.add_all([ Customer( id=i, name='c%d' % i, description="c%d" % i, - q="q%d" % i, - p="p%d" % i, - x="x%d" % i, - y="y%d" % i, + q=i * 10, + p=i * 20, + x=i * 30, + y=i * 40, ) for i in ids ]) |
