"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test/benchmark.py" between
roundup-1.6.1.tar.gz and roundup-2.0.0.tar.gz

About: Roundup is an highly customisable issue-tracking system with command-line, web and e-mail interfaces (written in Python).

benchmark.py  (roundup-1.6.1):benchmark.py  (roundup-2.0.0)
from __future__ import print_function
import sys, os, time import sys, os, time
from roundup.hyperdb import String, Password, Link, Multilink, Date, \ from roundup.hyperdb import String, Password, Link, Multilink, Date, \
Interval, DatabaseError, Boolean, Number Interval, DatabaseError, Boolean, Number
from roundup import date, password from roundup import date, password
from db_test_base import config from .db_test_base import config
def setupSchema(db, module): def setupSchema(db, module):
status = module.Class(db, "status", name=String()) status = module.Class(db, "status", name=String())
status.setkey("name") status.setkey("name")
user = module.Class(db, "user", username=String(), password=Password(), user = module.Class(db, "user", username=String(), password=Password(),
assignable=Boolean(), age=Number(), roles=String()) assignable=Boolean(), age=Number(), roles=String())
user.setkey("username") user.setkey("username")
file = module.FileClass(db, "file", name=String(), type=String(), file = module.FileClass(db, "file", name=String(), type=String(),
comment=String(indexme="yes")) comment=String(indexme="yes"))
issue = module.IssueClass(db, "issue", title=String(indexme="yes"), issue = module.IssueClass(db, "issue", title=String(indexme="yes"),
skipping to change at line 55 skipping to change at line 56
for i in range(numissues): for i in range(numissues):
db.user.create(**{'username': 'user %s'%i}) db.user.create(**{'username': 'user %s'%i})
for j in range(10): for j in range(10):
db.user.set(str(i+1), assignable=1) db.user.set(str(i+1), assignable=1)
db.user.set(str(i+1), assignable=0) db.user.set(str(i+1), assignable=0)
db.issue.create(**{'title': 'issue %s'%i}) db.issue.create(**{'title': 'issue %s'%i})
for j in range(10): for j in range(10):
db.issue.set(str(i+1), status='2', assignedto='2', nosy=[]) db.issue.set(str(i+1), status='2', assignedto='2', nosy=[])
db.issue.set(str(i+1), status='1', assignedto='1', db.issue.set(str(i+1), status='1', assignedto='1',
nosy=['1','2']) nosy=['1','2'])
if (i*100/numissues) != pc: if (i*100//numissues) != pc:
pc = (i*100/numissues) pc = (i*100//numissues)
sys.stdout.write("%d%%\r"%pc) sys.stdout.write("%d%%\r"%pc)
sys.stdout.flush() sys.stdout.flush()
db.commit() db.commit()
else: else:
db = backend.Database(config, 'admin') db = backend.Database(config, 'admin')
setupSchema(db, backend) setupSchema(db, backend)
sys.stdout.write('%7s: %-6d'%(backendname, numissues)) sys.stdout.write('%7s: %-6d'%(backendname, numissues))
sys.stdout.flush() sys.stdout.flush()
skipping to change at line 117 skipping to change at line 118
times.append(('filtml', time())) times.append(('filtml', time()))
# results # results
last = None last = None
for event, stamp in times: for event, stamp in times:
if last is None: if last is None:
first = stamp first = stamp
else: else:
sys.stdout.write(' %-6.2f'%(stamp-last)) sys.stdout.write(' %-6.2f'%(stamp-last))
last = stamp last = stamp
print ' %-6.2f'%(last-first) print(' %-6.2f'%(last-first))
sys.stdout.flush() sys.stdout.flush()
if __name__ == '__main__': if __name__ == '__main__':
# 0 1 2 3 4 5 6 # 0 1 2 3 4 5 6
# 01234567890123456789012345678901234567890123456789012345678901234 # 01234567890123456789012345678901234567890123456789012345678901234
print 'Test name fetch journl jprops lookup filter filtml TOTAL ' print('Test name fetch journl jprops lookup filter filtml TOTAL ')
for name in 'anydbm metakit sqlite'.split(): for name in 'anydbm metakit sqlite'.split():
main(name) main(name)
for name in 'anydbm metakit sqlite'.split(): for name in 'anydbm metakit sqlite'.split():
main(name, numissues=20) main(name, numissues=20)
for name in 'anydbm metakit sqlite'.split(): for name in 'anydbm metakit sqlite'.split():
main(name, numissues=100) main(name, numissues=100)
# don't even bother benchmarking the dbm backends > 100! # don't even bother benchmarking the dbm backends > 100!
for name in 'metakit sqlite'.split(): for name in 'metakit sqlite'.split():
main(name, numissues=1000) main(name, numissues=1000)
 End of changes. 5 change blocks. 
5 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)