{"id":16109897,"url":"https://github.com/clausklein/build-performance","last_synced_at":"2025-04-06T05:23:04.568Z","repository":{"id":151753707,"uuid":"239105421","full_name":"ClausKlein/build-performance","owner":"ClausKlein","description":"based on https://mesonbuild.com/Simple-comparison.html","archived":false,"fork":false,"pushed_at":"2021-10-19T18:22:08.000Z","size":40,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-02-12T11:13:46.081Z","etag":null,"topics":["ccache","ninja-build","performance-testing","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ClausKlein.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-08T10:05:19.000Z","updated_at":"2023-04-15T10:36:45.000Z","dependencies_parsed_at":"2023-04-27T05:47:24.820Z","dependency_job_id":null,"html_url":"https://github.com/ClausKlein/build-performance","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClausKlein%2Fbuild-performance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClausKlein%2Fbuild-performance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClausKlein%2Fbuild-performance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClausKlein%2Fbuild-performance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ClausKlein","download_url":"https://codeload.github.com/ClausKlein/build-performance/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247438096,"owners_count":20938864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ccache","ninja-build","performance-testing","python"],"created_at":"2024-10-09T19:34:50.594Z","updated_at":"2025-04-06T05:23:04.530Z","avatar_url":"https://github.com/ClausKlein.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"====================================\nSimple build performance comparison\n====================================\n\nThese simple python scripts are based on the idea at\nhttps://mesonbuild.com/Simple-comparison.html\n\nI use **ccache** and run the performance tests at least 2 times to decrease the\ncompile time for each build test run.\n\nThis bring into focus the performance of the buildsystem.\n\n\nSetup test suite::\n\n  clausklein$ ./gen_src.py build\n  generate 2 directories containing each 4 source files\n\nRun test suite::\n\n  clausklein$ ./measure.py build\n  Running command: rm -rf build-cmake \u0026\u0026 mkdir -p build-cmake \u0026\u0026 cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER_LAUNCHER=ccache -B build-cmake\n  Running command: make -C build-cmake -j 4\n  Running command: make -C build-cmake -j 4\n  Running command: make -C build-cmake -j 4 clean\n  Running command: make -C build-cmake -j 4\n  Running command: rm -rf build-cmake-ninja \u0026\u0026 mkdir -p build-cmake-ninja \u0026\u0026 cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER_LAUNCHER=ccache -B build-cmake-ninja -G Ninja\n  Running command: ninja -C build-cmake-ninja -j 4\n  Running command: ninja -C build-cmake-ninja -j 4\n  Running command: ninja -C build-cmake-ninja -j 4 clean\n  Running command: ninja -C build-cmake-ninja -j 4\n  Running command: rm -rf build-meson \u0026\u0026 mkdir -p build-meson \u0026\u0026 CC='ccache gcc' meson build-meson\n  Running command: ninja -C build-meson -j 4\n  Running command: ninja -C build-meson -j 4\n  Running command: ninja -C build-meson -j 4 clean\n  Running command: ninja -C build-meson -j 4\n  cmake-make\n   0.865 gen\n   0.518 build\n   0.189 empty build\n   0.095 clean\n   0.566 rebuild\n   2.234 overall\n  cmake-ninja\n   0.718 gen\n   0.188 build\n   0.013 empty build\n   0.032 clean\n   0.204 rebuild\n   1.155 overall\n  meson\n   1.611 gen\n   0.237 build\n   0.013 empty build\n   0.022 clean\n   0.219 rebuild\n   2.101 overall\n\n\nThe ninja based builds are the best as expected\n-----------------------------------------------\n\nOne interesting point is the different size of the generated ninja build files.\nThe meson build generator creates only one and a simpler and clear\n**build.ninja** file::\n\n  clausklein$ find build -name '*.ninja' -ls\n  81941300       48 -rw-r--r--    1 clausklein   staff   21306  8 Feb 10:17 build/buildcmakeninja/build.ninja\n  81941301        8 -rw-r--r--    1 clausklein   staff    2681  8 Feb 10:17 build/buildcmakeninja/rules.ninja\n  81941494       16 -rw-r--r--    1 clausklein   staff    5686  8 Feb 10:17 build/buildmeson/build.ninja\n  clausklein$\n\n\nAnd build performance with a real project\n------------------------------------------\n\nThe https://github.com/open-source-parsers/jsoncpp use both, *meson* and *cmake*::\n\n  bash-5.0$ python3 ./build_performance_measure.py\n  Running command: rm -rf build-cmake-ninja \u0026\u0026 mkdir -p build-cmake-ninja \u0026\u0026 CXX=g++ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release -G Ninja -B build-cmake-ninja\n  Running command: ninja -C build-cmake-ninja\n  Running command: ninja -C build-cmake-ninja\n  Running command: ninja -C build-cmake-ninja clean\n  Running command: ninja -C build-cmake-ninja\n  Running command: rm -rf build-meson \u0026\u0026 mkdir -p build-meson \u0026\u0026 CXX='ccache g++' meson build-meson\n  Running command: ninja -C build-meson\n  Running command: ninja -C build-meson\n  Running command: ninja -C build-meson clean\n  Running command: ninja -C build-meson\n  cmake-ninja\n   3.755 gen\n   0.739 build\n   0.018 empty build\n   0.044 clean\n   0.721 rebuild\n   5.276 overall\n  meson\n   1.918 gen\n   1.409 build\n   0.014 empty build\n   0.032 clean\n   1.410 rebuild\n   4.784 overall\n  bash-5.0$\n\n\nInteresting is here: The compact *meson.build* file (only 125 lines) generates\nfast a realy clear *build.ninja*, but needs more time to build (old i386 with\nonly 2 cores). Overall for this small project, mesonbuild is faster.\n\nIMHO: The winner seems https://mesonbuild.com using https://ninja-build.org and https://ccache.dev\n\n\nRecources\n----------\n\n**A nice project with a dual build system: cmake and meson**\n\n  * https://github.com/ClausKlein/jsoncpp I used it for the second performance test.\n\n* https://medium.com/@julienjorge/an-overview-of-build-systems-mostly-for-c-projects-ac9931494444\n* https://en.wikipedia.org/wiki/List_of_build_automation_software\n* https://trends.google.com/trends/explore?date=all\u0026q=bazel,meson,mpc-ace,%2Fm%2F04dl04,%2Fm%2F0cxh7f\n* http://esr.ibiblio.org/?p=8581\n* http://doc.cat-v.org/plan_9/4th_edition/papers/mk\n* https://medium.com/windmill-engineering/bazel-is-the-worst-build-system-except-for-all-the-others-b369396a9e26\n\n\nHistoric\n.........\n\n* https://www.google.com/search?q=%22Recursive+Make+Considered+Harmful%22+filetype%3Apdf\u0026oq=\u0026aqs=\n* https://manpages.debian.org/testing/mpc-ace/mpc-ace.1.en.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclausklein%2Fbuild-performance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclausklein%2Fbuild-performance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclausklein%2Fbuild-performance/lists"}