[Speed] To start work on "fat-python".

Victor Stinner victor.stinner at gmail.com
Wed Jun 28 08:29:35 EDT 2017


Hi,

FYI last year I proposed FAT Python as a GSoC project, but I failed to
pick a candidate. You may be interested by my project page:
http://fatoptimizer.readthedocs.io/en/latest/gsoc.html

And the TODO list:
http://fatoptimizer.readthedocs.io/en/latest/todo.html

The good news is that I rebased my FAT Python project recently on Git.
Previously, my fork was based on Mercurial, but CPython moved to Git
in the meanwhile.

To really test FAT Python, not only fatoptimizer, see instructions at:
https://faster-cpython.readthedocs.io/fat_python.html#getting-started

Sadly, it seems like there are bugs since I rebased my patches. Even
if I disabled function inlinling, I still get this strange error:
---
haypo at selma$ ./python -X fat -m test -v test_sys
...
test test_sys crashed -- Traceback (most recent call last):
  ...
  File "/home/haypo/prog/python/fatpython/Lib/test/libregrtest/save_env.py",
line 286, in get_sys_argv
AttributeError: 'list' object has no attribute 'description'
---

It's a bad in the optimizer, I don't get it when the FAT mode is disabled:
---
haypo at selma$ ./python -m test test_sys
...
Tests result: SUCCESS
---

Moreover, it seems like once .pyc files are created in FAT mode,
non-FAT mode (default mode) still uses the optimized .pyc files, which
is a bad :-/

haypo at selma$ ./python -X fat -m test -v test_sys
^C
haypo at selma$ find -name "*.pyc"
...
./Lib/test/__pycache__/__main__.cpython-37.pyc
...

The filename should contain "fat" somewhere. I made a mistake in my
PEP 511 backport:
http://bugs.python.org/issue26145

Good luck with all these things :-) FAT Python is a big project. The
problem is that I failed to prove that it really makes Python faster.
I stopped the project just after Dave Malcolm implemented function
inlining (which is still experimental = buggy), whereas this
optimization is likely to make CPython faster in a significant way.
It's just that I lost motivation, I put too much energy in this
project :-) So I switch to something else (which was FASTCALL).

Victor

2017-06-28 7:07 GMT+02:00 Bhavishya <bhavishyagopesh at gmail.com>:
> Hello,
> As you might have seen(on ML) "Lazy-loading" didn't worked and increased the
> startup time instead.
>
> In the meantime I had started with  "fat-python"(adding pure methods etc) so
> is that the right thing to do or you suggest something else...
>
> Thank You
> Regards,
> Bhavishya


More information about the Speed mailing list