Created
November 26, 2017 07:08
-
-
Save bosukh/e6fbeb76a0ced01ae345c67f31515844 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
def test_sqlalchemy_orm_bulk_update(n=100000): | |
init_sqlalchemy(False) | |
t0 = time.time() | |
DBSession.bulk_update_mappings( | |
Customer, | |
[{'name': 'NEW_NAME ' + str(i), 'id': i} | |
for i in xrange(1, n+1)] | |
) | |
DBSession.commit() | |
print( | |
"SQLAlchemy ORM bulk_update_mappings(): 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