[Grok-dev] Iterativly emptying a grok.container shows weird behavior

Dr. Volker Jaenisch volker.jaenisch at inqbus.de
Tue Jun 12 12:16:49 EDT 2007


HJi Tres!

Tres Seaver schrieb:
> Volker might like it more if the container had 100,000 items in it,
> where iterating over the keys rather than getting them all back as a
> list would be much faster.
>   
One of my professions is performance analysis and the optimisation of 
server-clusters.
At the moment I work on a performance comparison between Grok/ZODB and 
Grok/SQLAlchemy
for a project with far more than 100.000 Datasets.

I wrote this email purposeful from the perspective of the Enduser and 
not from my professional perspective.
I have hoped that my self ironic writing style has made that clear.

Yesterday I noticed that the tutorial (which I like otherwise very much) 
lead me to program nonsense.
Me as experianced programmer may find the error - the Enduser that GROK 
addresses may not.

> Mutating a container while iterating over it is always problematic.
I know. I would never wrote this code if I knew that I am ITERATING 
(using an iterator) over a
datastructure when using the .keys() methode.

If this methode was named .getIterator() I would have been warned.

Beste Regards

Volker

-- 
====================================================
   inqbus it-consulting      +49 ( 341 )  5643800
   Dr.  Volker Jaenisch      http://www.inqbus.de
   Herloßsohnstr.    12      0 4 1 5 5    Leipzig
   N  O  T -  F Ä L L E      +49 ( 170 )  3113748
====================================================



More information about the Grok-dev mailing list