Xmake v2.3.2 is released, bringing the same construction speed as ninja

Time:2021-8-13

This version focuses on refactoring and optimizing the internal parallel construction mechanism, realizing the parallel compilation of source files between multiple targets and the support of parallel links. At the same time, it optimizes some internal losses of xmake and fixes some bugs affecting the compilation speed.
Through test and comparison, the current overall construction speed is basically the same as that of ninja. Compared with cmake / make, meson / Ninja are much faster, because they have an additional step in the process of generating makefile / build.ninja.

In addition, xmake also adds support for Sdcc compilation tool chain, which is used to compile embedded programs such as 51 / stm8.

  • Project source code
  • Official documents

Some optimization points

  1. All source files between multiple targets are built in parallel at the same time (previously, they cannot cross targets, and they will be blocked and serialized by links in the middle)
  2. Multiple independent target links can be executed in parallel (previously, only one link can be executed one by one)
  3. Fix the previous task scheduling bug, make more fine-grained scheduling, and make full use of CPU core resources
  4. The effect of optimizing some losses on xmake’s internal API is also obvious

For more optimization details, see issue #589

Construction speed comparison

We have done some comparative tests on termux and MacOS. The test project is xmake core

For a relatively large number of target projects, the new version of xmake has significantly improved its construction speed.

Multitask parallel compilation test

Build system Termux (8core/-j12) Build system MacOS (8core/-j12)
xmake 24.890s xmake 12.264s
ninja 25.682s ninja 11.327s
cmake(gen+make) 5.416s+28.473s cmake(gen+make) 1.203s+14.030s
cmake(gen+ninja) 4.458s+24.842s cmake(gen+ninja) 0.988s+11.644s

Single task compilation test

Build system Termux (-j1) Build system MacOS (-j1)
xmake 1m57.707s xmake 39.937s
ninja 1m52.845s ninja 38.995s
cmake(gen+make) 5.416s+2m10.539s cmake(gen+make) 1.203s+41.737s
cmake(gen+ninja) 4.458s+1m54.868s cmake(gen+ninja) 0.988s+38.022s

Update content

New features

  • Add PowerShell color theme for background color display under PowerShell terminal
  • add toxmake --dry-run -vCommand to run the build empty, just to view the detailed build commands
  • #712: add Sdcc platform and support Sdcc compiler

improvement

  • #589: improve and optimize the construction speed, support cross target parallel compilation and link, and the compilation speed is basically the same as that of ninja
  • Improving Ninja / cmake project file generator plug-in
  • #728: improved os.cp to support recursive replication at the source directory structure level
  • #732: improved find_ Package supports finding packages installed by homebrew / cmake
  • #695: improved using the latest ABI naming of Android NDK

Bugs repair

  • Fix link error display in Windows
  • #718: fixed the problem of cache invalidation with a certain probability when dependent package downloads multiple images
  • #722: fix installation deadlock caused by invalid package dependency
  • #719: fixed the problem that the. Bat sub process failed to exit immediately after the main process received Ctrl C under windows
  • #720: repair compile_ Path escape of commands generator

Recommended Today

Detailed steps for installing Perl and Komodo IDE for windows

Perl official website: https://www.perl.org/Perl document: https://perldoc.perl.org/Download address: https://www.perl.org/get.html The installation package of Perl Windows version is divided into activestate Perl and strawberry Perl. For the difference between the two, see: http://www.zzvips.com/article/202134.htm Note: the download speed of activestate Perl is slow. You may need KX to surf the Internet I have uploaded all the versions of […]