MongoHQ can be useful for testing, they offer a free limited instance

https://mongohq.com/pricing



2010/12/7 mdipierro <mdipie...@cs.depaul.edu>

> I run some benchmarks. The time to do insert and select is the same.
> The difference it no measurable because dominated by db IO. Anyway the
> code is below and the output is:
>
> old dal:
> 7.98740386963e-05 (sec)
> 0.00134269499779
>
> new dal:
> 8.04572105408e-05
> 0.00139242005348
>
> Notice all the time is in the IO. The time to actually parse the
> complex query is negligible.
>
>
> code:
> import os
> os.system('rm *.sqlite test* *.table sql.log')
>
> #from dal import
> *
> from sql_old import *
> db=DAL('sqlite://test.sqlite')
> db.define_table('person',Field('name'))
> db(db.person).delete()
> db.commit()
>
> import time
>
> def t(f,n=1000):
>    t0=time.time()
>    for i in range(n): f()
>    return (time.time()-t0)/n
>
> def a():
>    db.person.insert(name='max')
> def b():
>    db((db.person.name=='max')&(db.person.name.like('max
> %'))&(db.person.name.startswith('m'))).select(limitby=(0,20))
>
> print t(a)
> print t(b)
>
>


-- 

Bruno Rocha
http://about.me/rochacbruno/bio

Reply via email to