Skip to content

Tracking issue for performance improvements PRs #14103

Open
@bonzini

Description

Describe the bug
Meson should be faster. :)

1.7.0 has some microoptimizations and there are several open PRs

  • use an unordered set for NinjaBuildElement (1.7.0)
  • cache more file operations (1.7.0)
  • cache version_compare results in compilers (1.7.0)
  • speed up regex usage (1.7.0)

For 1.8:

To Reproduce
I'm using QEMU as the reproducer (mkdir build && ../configure --enable-rust) just because it produces a very large build.ninja, but using other similarly large projects (e.g. mesa, libvirt or systemd) should be feasible. This patch needs to be applied (or something like that) to use an external meson version:

diff --git a/configure b/configure
index 18336376bff..842c31ced6f 100755
--- a/configure
+++ b/configure
@@ -999,8 +999,10 @@ mkvenv="$python ${source_path}/python/scripts/mkvenv.py"
 
 # Finish preparing the virtual environment using vendored .whl files
 
-$mkvenv ensuregroup --dir "${source_path}/python/wheels" \
-     ${source_path}/pythondeps.toml meson || exit 1
+$python -m pip install $HOME/work/upstream/meson
+ls -l pyvenv/bin
+#$mkvenv ensuregroup --dir "${source_path}/python/wheels" \
+#     ${source_path}/pythondeps.toml meson || exit 1
 
 # At this point, we expect Meson to be installed and available.
 # We expect mkvenv or pip to have created pyvenv/bin/meson for us.
@@ -1973,7 +1975,8 @@ if test "$skip_meson" = no; then
   test "$plugins" = yes && meson_option_add "-Dplugins=true"
   test "$tcg" != enabled && meson_option_add "-Dtcg=$tcg"
   run_meson() {
-    NINJA=$ninja $meson setup "$@" "$PWD" "$source_path"
+    #NINJA=$ninja time $python -m cProfile -o stats7.out -m mesonbuild.mesonmain setup "$@" "$PWD" "$source_path"
+    NINJA=$ninja time $meson setup "$@" "$PWD" "$source_path"
   }
   eval run_meson $meson_options
   if test "$?" -ne 0 ; then

system parameters
I am testing on Fedora 41 (Python 3.13)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions