[Python-Dev] PATCH: Fast globals/builtins lookups for 2.6

Armin Rigo arigo at tunes.org
Thu Dec 27 11:22:30 CET 2007


Hi Neil,

On Fri, Nov 30, 2007 at 09:14:04AM -0700, Neil Toronto wrote:
> >> whether 64 bits is necessary. It takes an hour of concerted effort - 
> >> nothing but "module.d = 1; del module.d" for an hour straight - to 
> >> overflow a 32-bit version number. Is anybody going to actually get close 
> >> to doing that in a global namespace?
> >>
> > Of course not. And 640k is as much memory as anyone could reasonably 
> > need ...
> 
> Point taken - forget I asked.

How much time does it take if the loop is in a C extension module, e.g.
like the following?

    while (1) { PyDict_SetItem(d, k, v); PyDict_DelItem(d, k); }

How much time would it take the same loop to overflow even the 64-bit
version number?  And how much will *this* take in ten year's time?


A bientot,

Armin


More information about the Python-Dev mailing list