GSOC 2019: Nuitka all built-ins optimized
See original GitHub issueProject description: Nuitka has support for many built-ins, e.g. len
already, which means dedicated C code, compile time evaluation, type shapes produced (in this case an int
), but there are some notable exceptions, e.g. enumerate
where we know types too, that are still missing, but definitely can have high performance impact on some loops.
Your task would be to immitate existing built-in codes to achieve a complete support for ultimately all C built-ins. The first step would be to identify which ones are missing (by means of a warning added), then to find out in test runs of the test suites, which ones are warned about, and to resolve as many of those as possible. It is assumed that all should be possible.
Skills: Python and C programming, platform wouldn’t matter
Issue Analytics
- State:
- Created 5 years ago
- Comments:16 (13 by maintainers)
Top GitHub Comments
As you can see, this is going to give you a nice tour of Nuitka from optimization to code generation, and across various built-ins you may not even know exist, even if you are proficient at Python. I sure didn’t know all of those implemented so far.
@bksahu So this is an example of expected effect for generated C code:
Using this test program:
I got that by disabling the
len
built-in call optimization, and it shows that instead of calling the built-in namelen
as a generic function call, we have the dedicated helperBUILTIN_LEN
being called.That is the kind of difference this is about when facing C code. As you can see, this code is not only simpler, but
BUILTIN_LEN
will be visible to the linker for link time optimization (LTO) once we have that, and can become amazingly faster instead of a relatively generic Python call.