← Back to team overview

u1db-discuss team mailing list archive

Re: API Design

 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/15/2011 4:39 PM, Mikkel Kamstrup Erlandsen wrote:
> On 11/15/2011 04:10 PM, John Meinel wrote:
>> 
>> It would be nice to see real benchmarks before we decide it is 
>> necessary. The DB is intended to be size limited (~20MB per db
>> per user). I have a dataset of 50k docs that totals 33MB in JSON,
>> and ~60MB in sqlite. I can deserialize all docs in <1s (I'll try
>> to get a more accurate timing) in python.
>> 
> 
> I'll whip up a tool to compare plain column-field mapping, json,
> and gvariant extracted from an sqlite db, with datasets of
> different sizes. Column-field mapping probably being the benchmark
> for everything else.
> 
> Where I am coming from 1s is an eternity. I am interested in how
> much data you can pull out or insert without skipping too many
> frames (also on embedded devices). I realize that one probably
> wouldn't ever try to deserialize 50k docs on an embedded device, so
> I'll make sure we can test with different sized corpora.


The point is that it is 50k entries, so that makes it 20microseconds
per document.

I did post updated timings using BSON and JSON on my machine. BSON at
best was only 30% faster (1.1s to BSON encode 50k entries, vs 1.4s to
simplejson.dumps). And note that simplejson supports an array, which
made it able to encode all the entries in one request at 0.87s.

Making simplejson actually 25% faster than bson.

So some of it depends on the benchmark you use, but a +-30% difference
does not seem particularly significant.

If we were talking orders of magnitude, then we could spend more time
considering it.

It is possible that python is the overhead, but we're still talking
much less than a millisecond per document for serialization and
deserialization. (The slowest value was 28us to encode using
simplejson one-by-one, and the fastest was 17.3us to decode simplejson
all-at-once.)

So what is 'fast' enough? Sure 1s is a long time, but ~20us doesn't
seem particularly long.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7Ciu8ACgkQJdeBCYSNAAMM1wCfek/lTclBzGKHEuiBLYIuCgcv
3CAAn1AgC3fD1JfeomcNkv6Itt398oOW
=JxaS
-----END PGP SIGNATURE-----


References