Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Re: Performance ordered dictionary vs normal dictionary (http://www.velocityreviews.com/forums/t729466-re-performance-ordered-dictionary-vs-normal-dictionary.html)

Chris Rebert 07-29-2010 06:11 AM

Re: Performance ordered dictionary vs normal dictionary
 
On Wed, Jul 28, 2010 at 8:12 PM, Navkirat Singh <navkirats@gmail.com> 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 track. The dictionary object will do this for me. I was
> initially using a plain dictionary object, but I read this in the
> documentation that made me think about the question I asked :-


Does your program actually make use of the ordering? If so, then yes,
using OrderedDict is obviously preferable (Why reimplement something
needlessly?). If not, then why bother with the extra complication?

(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?)

Cheers,
Chris
--
http://blog.rebertia.com


All times are GMT. The time now is 08:02 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.