[Python-Dev] Split unicodeobject.c into subfiles

M.-A. Lemburg mal at egenix.com
Thu Oct 25 11:49:48 CEST 2012


On 25.10.2012 11:18, Maciej Fijalkowski wrote:
> On Thu, Oct 25, 2012 at 8:57 AM, M.-A. Lemburg <mal at egenix.com> wrote:
>> On 25.10.2012 08:42, Nick Coghlan wrote:
>>>> Why are any of these codecs here in unicodeobjectland in the first
>>>> place?  Sure, they're needed so that Python can find its own stuff,
>>>> but in principle *any* codec could be needed.  Is it just an heuristic
>>>> that the codecs needed for 99% of the world are here, and other codecs
>>>> live in separate modules?
>>>
>>> I believe it's a combination of history and whether or not they're
>>> needed by the interpreter during the bootstrapping process before the
>>> encodings namespace is importable.
>>
>> They are in unicodeobject.c so that the compilers can inline the
>> code in the various other places where they are used in the Unicode
>> implementation directly as necessary and because the codecs use
>> a lot of functions from the Unicode API (obviously), so the other
>> direction of inlining (Unicode API in codecs) is needed as well.
> 
> I'm sorry to interrupt, but have you actually measured? What effect
> the lack of said inlining has on *any* benchmark is definitely beyond
> my ability to guess and I suspect is beyond the ability to guess of
> anyone else on this list.
> 
> I challenge you to find a benchmark that is being significantly
> affected (>15%) with the split proposed by Victor. It does not even
> have to be a real-world one, although that would definitely buy it
> more credibility.

I think you misunderstood. What I described is the reason for having
the base codecs in unicodeobject.c.

I think we all agree that inlining has a positive effect on
performance. The scale of the effect depends on the used compiler
and platform.

Victor already mentioned that he'll check the impact of his
proposal, so let's wait for that.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Oct 25 2012)
>>> Python Projects, Consulting and Support ...   http://www.egenix.com/
>>> mxODBC.Zope/Plone.Database.Adapter ...       http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2012-09-27: Released eGenix PyRun 1.1.0 ...       http://egenix.com/go35
2012-09-26: Released mxODBC.Connect 2.0.1 ...     http://egenix.com/go34
2012-10-29: PyCon DE 2012, Leipzig, Germany ...             4 days to go

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/


More information about the Python-Dev mailing list