Created
December 11, 2019 16:54
-
-
Save cjsmeele/1f2b72b6584caf569c8ca208ed964e61 to your computer and use it in GitHub Desktop.
This file contains 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
# Include in core.py, and run as: `irule test null null` | |
# Results end up in rodsLog. | |
# | |
# My results with 9052 collections and 10 tests for each genquery version: | |
# | |
# original row_iterator: avg: 739ms, max: 821ms, min: 715ms | |
# extended row_iterator: avg: 376ms, max: 388ms, min: 367ms | |
import time | |
import genquery | |
def f(callback): | |
x = time.time() | |
print(len(list(genquery.row_iterator('COLL_NAME', '', genquery.AS_LIST, callback)))) | |
y = time.time() | |
return int((y-x)*1000) | |
def test(rule_args, callback, rei): | |
ts = [] | |
for i in range(10): | |
x = f(callback) | |
ts += [x] | |
print('time: %4dms' % x) | |
print('avg: %4dms, max: %4dms, min: %4dms' % (sum(ts)/len(ts), max(ts), min(ts))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment