Re: We need to do something about build times

From: Daniel Engberg <daniel.engberg.lists_at_pyret.net>
Date: Sun, 17 Dec 2023 14:14:17 UTC
Hi,

Given the discussion about build times I decided test a handful of ports to see if we could reduce time spent just by converting to either CMake or Meson depending on what upstream offers.

Hardware: Oracle VM, 4x Neoverse N1 cores, 24Gb of RAM
Software: FreeBSD 14.0, Poudriere (devel) 3.4.99.20231211

archivers/zstd		gmake 		--> meson
audio/flac		libtool		--> cmake
audio/opus		gmake, libtool	--> meson
graphics/lcms2		libtool		--> meson
graphics/webp		libtool		--> cmake
multimedia/libmediainfo libtool		--> cmake
multimedia/libzen	libtool		--> cmake
multimedia/mp4v2	gmake, libtool	--> cmake
net/libngtcp2		libtool		--> cmake
www/libnghttp3		libtool		--> cmake
www/libnghttp2		libtool		--> cmake

Makefile / Autotools
[00:08:20] Built ports: www/libnghttp2 archivers/zstd multimedia/libzen graphics/tiff www/libnghttp3 ftp/curl audio/flac graphics/lcms2 graphics/webp multimedia/mp4v2 audio/opus net/libngtcp2 multimedia/libmediainfo
[132aarch64-dev-default] [2023-12-17_12h42m54s] [committing] Queued: 13 Built: 13 Failed: 0  Skipped: 0  Ignored: 0  Fetched: 0  Tobuild: 0   Time: 00:08:18

CMake / Meson
[00:05:16] Built ports: archivers/zstd www/libnghttp2 multimedia/libzen graphics/tiff www/libnghttp3 audio/flac ftp/curl graphics/lcms2 graphics/webp multimedia/libmediainfo multimedia/mp4v2 net/libngtcp2 audio/opus
[132aarch64-dev-default] [2023-12-17_13h06m03s] [committing] Queued: 13 Built: 13 Failed: 0  Skipped: 0  Ignored: 0  Fetched: 0  Tobuild: 0   Time: 00:05:13

It may not be the most exact benchmark but results are reproducible. Keep in mind that this is more or less a free performance improvement without any hardware modifications. While some projects benefit more than others there might be cases where switching isn't possible without upstreaming changes but it's likely worth the effort in the long run as you in general see an improvment. I'd also like to remind people that while CMake and Meson can take a little while to build initially gmake and/or libtool also have their dependency chain so none are "free" and the difference is likely less than what you expect.

Best regards,
Daniel (diizzy@)