473,320 Members | 2,177 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

shelve slow in python 2.3.3 for windows

I already submitted a bug, but I'm curious to know if anybody ran into
this.
Try this program on Windows with python 2.3.3 and with python 2.2:

import shelve
a=shelve.open("a", "c")
for x in xrange(10000):
a[str(x)]=x
print str(x) + "\r",
a.close()

After about 7000/8000 insertions, the program gets so slow...
With python 2.2 it ends in a blink!
Really strange, isn't it?

Ciao.
Marco.
Jul 18 '05 #1
5 1576

Marco> Try this program on Windows with python 2.3.3 and with python 2.2:

Marco> import shelve
Marco> a=shelve.open("a", "c")
Marco> for x in xrange(10000):
Marco> a[str(x)]=x
Marco> print str(x) + "\r",
Marco> a.close()

Marco> After about 7000/8000 insertions, the program gets so slow...
Marco> With python 2.2 it ends in a blink!
Marco> Really strange, isn't it?

Perhaps not. After running your script, what does

whichdb.whichdb("a")

report under both versions? My wild-ass guess is that the underlying anydbm
module finds dumbdbm under 2.3.3 and something more industrial strength like
bsddb under 2.2.

Skip

Jul 18 '05 #2
On Wed, 21 Jan 2004 15:47:20 -0600, Skip Montanaro <sk**@pobox.com>
wrote:
whichdb.whichdb("a")
report under both versions? My wild-ass guess is that the underlying anydbm
module finds dumbdbm under 2.3.3 and something more industrial strength like
bsddb under 2.2.


Skip,
you are right!

Under 2.3.3: 'dbhash'

Under 2.2: 'bsddb185'

Now the question is: is it possible to use bsddb185 with python 2.3.3?

Thanks.
Ciao.
Marco.
Jul 18 '05 #3
whichdb.whichdb("a")
report under both versions? My wild-ass guess is that the underlying
anydbm module finds dumbdbm under 2.3.3 and something more industrial
strength like bsddb under 2.2.


Marco> Skip,
Marco> you are right!

Sort of.

Marco> Under 2.3.3: 'dbhash'

Marco> Under 2.2: 'bsddb185'

'dbhash' and 'bsddb185' are really the same beast.

Marco> Now the question is: is it possible to use bsddb185 with python
Marco> 2.3.3?

You're barking up the wrong tree. That's not the problem.

Skip

Jul 18 '05 #4
On Wed, 21 Jan 2004 18:37:17 -0600, Skip Montanaro <sk**@pobox.com>
wrote:
'dbhash' and 'bsddb185' are really the same beast.

Marco> Now the question is: is it possible to use bsddb185 with python
Marco> 2.3.3?

You're barking up the wrong tree. That's not the problem.


So you're telling me that dbhash (namely /python2.3/DLLs/_bsddp.pyd)
on python 2.3.3 for Windows has a problem?
Jul 18 '05 #5

Skip> 'dbhash' and 'bsddb185' are really the same beast.

Marco> Now the question is: is it possible to use bsddb185 with python
Marco> 2.3.3?

Skip> You're barking up the wrong tree. That's not the problem.

Marco> So you're telling me that dbhash (namely
Marco> /python2.3/DLLs/_bsddp.pyd) on python 2.3.3 for Windows has a
Marco> problem?

It would seem so. See my most recent post to your bug report. Switching
between bsddb.hashopen and bsddb.btopen seems to make a huge difference.

Skip
Jul 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rami A. Kishek | last post by:
Hi - this mysterious behavior with shelve is just about to kill me. I hope someone here can shed some light. First of all, I have this piece of code which uses shelve to save instances of some...
0
by: seth | last post by:
Last week I encountered an AttributeError in my unit tests that I wasn'table to catch with an "except AttributeError" statement. The problem stemmed from a class that raised an error inside...
1
by: Eric Wichterich | last post by:
Hello Pythonistas, I use Python shelves to store results from MySQL-Queries (using Python for web scripting). One script searches the MySQL-database and stores the result, the next script reads...
0
by: ex laguna | last post by:
Hi, I have ran into a problem with py2exe 0.5.0 and shelve in python 2.3.3. The script works fine standalone, but not with py2exe. Does anyone have a solution of workaround for this? Thanks...
0
by: Michael Mulcahy | last post by:
Hi All, Problem: Shelve module doesn't like me OS: Win2000 version: 2.3.3 Here is simple reproduction code and the error that occurs: import shelve, anydbm
1
by: Tor Erik Soenvisen | last post by:
Hi, Have a problem using shelve on windows and unix. While my windows box supports dbhash, my unix box supports gdbm, and neither supports what the other does. The problem arises when I try to...
5
by: gluckj | last post by:
Hi, I'm not a Win ME fan myself (I'm a Mac user), but I'm here in Thailand developing software for special-needs kids, and the test PC in my home office is a Win ME machine (sigh). So when I...
1
by: Matthew Schibler | last post by:
I'm a newbie to Python, with some experience using perl (where I used nested arrays and hashes extensively). I am building a script in python for a MUD I play, and I want to use the shelve module...
0
by: Edwin.Madari | last post by:
since choice of dbm used by shelve http://docs.python.org/lib/node327.html depends on os, and whats available on it, shevle files saved on one os, most likely do not work on another os, sometimes on...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.