Most efficient way to build very large dictionaries

Roger Binns rogerb at rogerbinns.com
Wed Dec 24 09:19:56 CET 2008


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

python at bdurham.com wrote:
> I would appreciate your thoughts on whether there are advantages to
> working with a pre-built dictionary and if so, what are the best ways to
> create a pre-loaded dictionary.

Based on this and your other thread, you may want to consider using
SQLite (standard Python module is available for it).  SQL queries are
very similar to set operations and indices take care of performance (by
using more storage).  You also get transactions for free.  If you look
into SQLite pragmas you can get it to use more RAM to improve performance.

And by using a SQL layer you can later switch to another database should
you need really hard core storage.  It also makes the data available to
other programs in a uniform way.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAklR8KgACgkQmOOfHg372QSrHQCfVJzueXVKme8QZcxoLf70BL4K
RL8AoM9QOFykOLrr5QXtpmZ5f7CFHm6e
=zAPG
-----END PGP SIGNATURE-----




More information about the Python-list mailing list