Geez, Brian, you're a wizard! >>> reload(mk4) start... 0, time: 4.53, delta: 4.53 100000, time: 6.61, delta: 2.08 200000, time: 9.64, delta: 3.03 300000, time: 12.44, delta: 2.80 400000, time: 15.30, delta: 2.86 500000, time: 18.52, delta: 3.22 600000, time: 21.30, delta: 2.78 Values written, now syncing, time: 22.83 After syncing: 23.08 end.
That's half of the time of BSDDB! I ran that three times to see if it's not some glitch, but no, all the results are very close to each other. BK> There are a couple of ways you can speed up your code here which I BK> will get to in a moment. You make a point about the speed of mk BK> versus the speed of raw python dictionary, Actually, that was Wolfgang. BK> but you have to realize BK> that the cost of loading in mk or sqlite largely depends on the fact BK> that you are going to perform relational operations on the data. If BK> you are not planning on relational operations, mk is probably not BK> appropriate. I don't think it could ever get as good as operations on disk-based data structures being comparable in speed to memory-based data structures. It's unrealistic to expect that I think, unless you're some sort of Donald Knuth on steroids. BK> What I mean, is if you just need a key->data mapping, then bsddb3 is BK> the right thing here. However, if you have multiple views that need BK> to be joined together, sorted, grouped etc then metakit/sq lite is BK> very appropriate. Except that using SQL is cumbersome or outright impractical in many scenarios, esp. when the result of query is too big to reasonably fit in memory, because you need to do operations on the data that cannot be done with SQL. If SQL suits the particular application, it works fine, but if not, it's cumbersome. The reasons I started looking at MK were derived views, slicing, joins, etc. Thanks for the help, Brian, now I have to go away to munch on all that. -- Best regards, Marcin mailto:[EMAIL PROTECTED] _____________________________________________ Metakit mailing list - [email protected] http://www.equi4.com/mailman/listinfo/metakit
