Josiah> The version I just posted to the tracker reads/writes about 30k Josiah> entries/second. You may want to look at the differences (looks Josiah> to be due to your lack of a primary key/index).
me> Thanks. The real speedup was to avoid using cursors. Let me take another stab at this. My __setitem__ looks like this: def __setitem__(self, key, val): c = self._conn.cursor() c.execute("replace into dict" " (key, value) values (?, ?)", (key, val)) self._conn.commit() This works (tests pass), but is slow (23-25 msec per loop). If I change it to this: def __setitem__(self, key, val): self._conn.execute("replace into dict" " (key, value) values (?, ?)", (key, val)) which is essentially your __setitem__ without the type checks on the key and value, it runs much faster (about 300 usec per loop), but the unit tests fail. This also works: def __setitem__(self, key, val): self._conn.execute("replace into dict" " (key, value) values (?, ?)", (key, val)) self._conn.commit() I think you need the commits and have to suffer with the speed penalty. Skip _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com