How to write Inline Functions in Python?

David Brown david at no.westcontrol.spam.com
Thu Nov 14 07:47:09 EST 2002


"Neil Hodgson" <nhodgson at bigpond.net.au> wrote in message
news:EDLA9.27101$eX.71749 at news-server.bigpond.net.au...
> David Brown:
>
> > As long as C(++) compilers
> > still generate seperate completed object code modules that are only
> > collected by a linker, then you are going to get a performance hit
> whenever
> > a small function from one module is used by a function in another
module.
>
>    Current compilers are able to inline across compilation units. See, for
> example,
> http://msdn.microsoft.com/msdnmag/issues/02/05/Hood/default.aspx
>    although IIRC other compilers beat MSVC to this particular
optimization.
>

That was a very interesting - that is exactly the sort of thing I was
thinking of.  I have never had occasion to use MS compilers, so I hadn't
come across this.  The question then is when will gcc support such link-time
code generation, because until then, inlined functions in headers will
remain an issue.







More information about the Python-list mailing list