Skip to content

Unchanged python files are byte-compiled (again) with --only-changed #15531

@orlitzky

Description

@orlitzky

When python.bytecompile is nonnegative, running meson install --only-changed will recompile source files that were not changed (and not reinstalled). In a large project this is a significant speed bump. For example, my workflow in SageMath:

$ meson setup -Dpython.bytecompile=-1 builddir
$ meson install -C builddir
$ time meson install --only-changed -C builddir
...
Preserved 5247 unchanged files, see meson-logs/install-log.txt for the full list

real	0m3.496s
user	0m2.770s
sys	0m0.722s

But with the default python.bytecompile=0...

$ meson setup builddir
$ meson install -C builddir
$ time meson install --only-changed -C builddir
...
Compiling '/home/mjo/.local/lib/python3.13/site-packages/sage/sat/converters/anf2cnf.py'...
Preserved 5247 unchanged files, see meson-logs/install-log.txt for the full list

real	0m51.883s
user	0m39.506s
sys	0m12.034s

Metadata

Metadata

Assignees

No one assigned

    Labels

    modules:pythonIssues specific to the python module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions