[Python-Dev] Status of dictnotes.txt?

2008-09-22 Thread Brendan O'Connor
Hi everyone,

I was enjoying reading Raymond Hettinger's Objects/dictnotes.txt, and
was wondering, which (if any) of its suggestions implemented?  I see
most of it was written back in 2003.

Thanks,
Brendan
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Status of dictnotes.txt?

2008-09-23 Thread Brendan O'Connor
> If I remember correctly (and based on a skimming of dictnotes.txt),
> those aren't suggestions, it is documentation about the actual
> implementation and why those decisions were made.

Well, some of the document is written as "if we did X, then we'd see
Y" so it's not always clear.  Some parts are clearly not implemented,
e.g. read-only freezing.  Some parts are implemented but slightly
differently -- e.g. small dicts are specialized to be faster, but the
document talks about specializing lookdict() and lookdict_string()
with linear search; however, as far as I can tell,
PyDictObject->ma_smalltable is used for small dictionaries, with the
standard hashing algorithm.

This is a little confusing because the ma_lookup() function pointer is
used as indirection; I was thinking that maybe there was a linear
search version, but actually it looks like it's just set to
lookdict_string() then switches to lookdict() if there's ever a
non-string key.  lookdict[_string]() always uses hashing.

Anyway, if anyone who knows about this or dictnotes.txt in general is
reading, feel free to pipe in :)

Brendan
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Using Cython for standard library?

2008-11-04 Thread Brendan O'Connor
>>> Is using Cython for anything in Modules/ really an option? In my limited
>>> experiments with it, I did like it.
>>>
>>> But using it for Python standard library stuff doesn't look quite right to
>>> me:
>>>
>>> - Option 1: distribute Cython with Python and integrate into build process
>>> -- Ouch!
>>
>> Can you be a bit more descriptive?
>
> Cython is still being worked on (intensively, it seems). Bundling it
> with Python means deciding on a particular version probably for
> an entire major release lifecycle (use Cython x.y.{newest} for
> Python 2.7, for example).

If we're talking about Cython for core libraries...

For the subset of python that also works in Cython, I've seen a 10-30%
performance speedups on (admittedly trivial) test code.  Conceivably,
*everything* could be Cython-compiled if you cared about performance
more than transparency.

Brendan
anyall.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com