Skip to content

Instantly share code, notes, and snippets.

@bosukh
Created November 26, 2017 07:11
Show Gist options
  • Save bosukh/2358fc79a9497ccabe55dc11c4c3d2bb to your computer and use it in GitHub Desktop.
Save bosukh/2358fc79a9497ccabe55dc11c4c3d2bb to your computer and use it in GitHub Desktop.
import time
def test_sqlalchemy_core_update(n=100000):
init_sqlalchemy(False)
t0 = time.time()
engine.execute(
Customer.__table__.update(),
[{'name': 'NEW_NAME ' + str(i), '_id': i}
for i in xrange(1, n+1)]
)
print(
"SQLAlchemy Core: Total time for " + str(n) +
" records " + str(time.time() - t0) + " secs")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment