|
|
Subscribe / Log in / New account

I'm confused...

I'm confused...

Posted Oct 1, 2018 14:39 UTC (Mon) by jamesh (guest, #1159)
In reply to: I'm confused... by jtaylor
Parent article: Nuitka 0.60 released

And by generating code that uses the libpython C API, it means that it can trivially call into CPython extension modules.

I guess the main opportunities for optimisation would come from identifying occasions when it is safe _not_ to use the libpython API. For example, if you know the two values you are adding are integers then generate code that adds two ints rather than calling PyNumber_Add() on two PyObjects.


to post comments

I'm confused...

Posted Oct 1, 2018 15:10 UTC (Mon) by kayhayen (guest, #127589) [Link]

That's exactly what it does. Initially it basically only meant to replace bytecode with Python C/API call, then avoid that as much as possible, and lately, with 0.6.0 first for bool, for 0.6.1 for void, and hopefully soon for int, to stay within C types as much as possible.

I call it graceful degradation. Code that can be fast should be. And if you go all in on special Python features it will become less optimized, but still faster.

Obviously a very hard project that I am in there, but from now on I am hoping to improve performance with every release for the 0.6.x series, whereas 0.5.x had 33 teleases preparing that in the background mostly.

Yours,
Kay (Author of Nuitka)


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds