[pybsddb] Closing a large read only btree takes a long time - possible to use DB_NOSYNC?

Chris Mulligan chris at polimetrix.com
Mon Apr 7 16:23:59 CEST 2008


First, please accept my apologies for the long delay in returning to
this discussion. 

Second, it looks like I was wrong in the end. The issue was with the
class someone else on the team wrote. The original code looks like this,
and the issue should be obvious, it reads the entire b-tree just to
check if it exists. (self._db = bsddb.btopen())

def close(self):
    if self._db:
        self._db.close()
        self._db = None

It's been replaced with:
def close(self):
    try:
        needToClose = self._db.isOpen()
    except AttributeError:
        needToClose = False
    if needToClose:
        self._db.close()
        self._db = None

This reduced one job I was running from ~120 minutes to ~15 minutes.

-----Original Message-----
From: pybsddb-bounces at argo.es [mailto:pybsddb-bounces at argo.es] On Behalf
Of Jesus Cea
Sent: Wednesday, March 26, 2008 7:00 PM
To: Python bindings for Oracle Berkeley DB
Subject: Re: [pybsddb] Closing a large read only btree takes a long time
- possible to use DB_NOSYNC?

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

Chris Mulligan wrote:
| I'm working on a test case now, I'll send you the code in a couple
hours
| when I've confirmed it "works".

In a couple of hours I should be sleeping, but I will look at it
tomorrow :).

Currently investigating a memory corruption in last pybsddb development
version :). So much to do, so little time... :)

- --
Jesus Cea Avion                         _/_/      _/_/_/        _/_/_/
jcea at argo.es http://www.argo.es/~jcea/ _/_/    _/_/  _/_/    _/_/  _/_/
jabber / xmpp:jcea at jabber.org         _/_/    _/_/          _/_/_/_/_/
~                               _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBR+rVVplgi5GaxT1NAQL1CAP+L6H6N3EJPtklvys1KofHudbkf3HM9xGb
GTEZpQ8+ibMipuz2AAPlTjjAow7pd4psZBp/OM3CZbGO4ayQexlgbAaF5wdQW95W
XVcqN2UEr2aJF2qAgSMkMemBo3EvDMRP8PFVftJqcNPF14Ru5N5FMrzS7mqSwjBr
z0iFdrUEqp0=
=DiR1
-----END PGP SIGNATURE-----
_______________________________________________
pybsddb mailing list
pybsddb at argo.es
http://mailman.argo.es/listinfo/pybsddb
http://www.argo.es/~jcea/programacion/pybsddb.htm




More information about the pybsddb mailing list