Re: Performance ordered dictionary vs normal dictionary

2010-08-03 Thread Chris Rebert
On Fri, Jul 30, 2010 at 9:18 PM, Dan Stromberg wrote: > On Wed, Jul 28, 2010 at 11:11 PM, Chris Rebert wrote: >> (You are aware that the "ordered" in OrderedDict means that its keys >> are ordered, and not that, say, a list containing OrderedDicts can be >> sorted, right?) > > > Actually, a coll

Re: Performance ordered dictionary vs normal dictionary

2010-07-30 Thread Dan Stromberg
On Wed, Jul 28, 2010 at 11:11 PM, Chris Rebert wrote: > On Wed, Jul 28, 2010 at 8:12 PM, Navkirat Singh > wrote: > > Sorry, I might have been a bit vague: > > (Also, I am new to pythong) > > I am trying to do construct my own web session tracking algorithm for a > web > > server (which also I ha

Re: Performance ordered dictionary vs normal dictionary

2010-07-29 Thread Navkirat Singh
On 29-Jul-2010, at 2:50 PM, Hrvoje Niksic wrote: > sturlamolden writes: > >> On 29 Jul, 03:47, Navkirat Singh wrote: >> >>> I was wondering what would be better to do some medium to heavy book >>> keeping in memory - Ordered Dictionary or a plain simple Dictionary object?? >> >> It depends

Re: Performance ordered dictionary vs normal dictionary

2010-07-29 Thread Hrvoje Niksic
sturlamolden writes: > On 29 Jul, 03:47, Navkirat Singh wrote: > >> I was wondering what would be better to do some medium to heavy book keeping >> in memory - Ordered Dictionary or a plain simple Dictionary object?? > > It depends on the problem. A dictionary is a hash table. An ordered > dict

Re: Performance ordered dictionary vs normal dictionary

2010-07-29 Thread Raymond Hettinger
On Jul 28, 6:47 pm, Navkirat Singh wrote: > I was wondering what would be better to do some medium > to heavy book keeping in memory - Ordered Dictionary > or a plain simple Dictionary object?? The current implementation of OrderedDict is based on regular dictionaries, so it performance cannot be

Re: Performance ordered dictionary vs normal dictionary

2010-07-29 Thread Shashwat Anand
> > > It depends on the problem. A dictionary is a hash table. An ordered > dictionary is a binary search tree (BST). Those are different data > structures. > > The main things to note is that: > > - Access is best-case O(1) for the hash table and O(log n) for the > BST. > > - Worst case behavior i

Re: Performance ordered dictionary vs normal dictionary

2010-07-28 Thread Navkirat Singh
On 29-Jul-2010, at 11:41 AM, Chris Rebert wrote: > On Wed, Jul 28, 2010 at 8:12 PM, Navkirat Singh wrote: >> Sorry, I might have been a bit vague: >> (Also, I am new to pythong) >> I am trying to do construct my own web session tracking algorithm for a web >> server (which also I have constructe

Re: Performance ordered dictionary vs normal dictionary

2010-07-28 Thread Chris Rebert
On Wed, Jul 28, 2010 at 8:12 PM, Navkirat Singh wrote: > Sorry, I might have been a bit vague: > (Also, I am new to pythong) > I am trying to do construct my own web session tracking algorithm for a web > server (which also I have constructed). The book keeping is for the session > information I t

Re: Performance ordered dictionary vs normal dictionary

2010-07-28 Thread Chris Rebert
On Wed, Jul 28, 2010 at 9:06 PM, sturlamolden wrote: > On 29 Jul, 03:47, Navkirat Singh wrote: >> I was wondering what would be better to do some medium to heavy book keeping >> in memory - Ordered Dictionary or a plain simple Dictionary object?? > > It depends on the problem. A dictionary is a

Re: Performance ordered dictionary vs normal dictionary

2010-07-28 Thread Navkirat Singh
On 29-Jul-2010, at 9:36 AM, sturlamolden wrote: > On 29 Jul, 03:47, Navkirat Singh wrote: > >> I was wondering what would be better to do some medium to heavy book keeping >> in memory - Ordered Dictionary or a plain simple Dictionary object?? > > It depends on the problem. A dictionary is a

Re: Performance ordered dictionary vs normal dictionary

2010-07-28 Thread sturlamolden
On 29 Jul, 03:47, Navkirat Singh wrote: > I was wondering what would be better to do some medium to heavy book keeping > in memory - Ordered Dictionary or a plain simple Dictionary object?? It depends on the problem. A dictionary is a hash table. An ordered dictionary is a binary search tree (B

Re: Performance ordered dictionary vs normal dictionary

2010-07-28 Thread Chris Rebert
On Wed, Jul 28, 2010 at 6:47 PM, Navkirat Singh wrote: > Hi guys, > > I was wondering what would be better to do some medium to heavy book keeping > in memory - Ordered Dictionary or a plain simple Dictionary object?? Your question is rather vague. Define "book keeping". Why do you feel an Order

Performance ordered dictionary vs normal dictionary

2010-07-28 Thread Navkirat Singh
Hi guys, I was wondering what would be better to do some medium to heavy book keeping in memory - Ordered Dictionary or a plain simple Dictionary object?? Regards, N4v -- http://mail.python.org/mailman/listinfo/python-list