Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def bench_sqlalchemy(loops, npeople):
# drop rows created by the previous benchmark
session.query(Person).delete(synchronize_session=False)
session.query(Address).delete(synchronize_session=False)
session.expunge_all()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be a more realistic test to use a new session for each loop here

like

for loops in range(loops):
    with DBSession() as session:
         # everything else here

cheaper than calling expunge_all() and makes it clear where we're starting the operation


# Run the benchmark once
t0 = pyperf.perf_counter()
Expand Down
Loading