From 9cd1e917ef3299e3ff256e5bc08af55514513f3f Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 12 Feb 2025 20:57:51 -0500 Subject: [PATCH] libroot/posix: Enable OpenBSD malloc by default. jam HaikuDepot with nothing to do, best of many runs: hoard2 real 0m3.519s user 0m3.348s sys 0m0.159s openbsd real 0m3.481s user 0m3.327s sys 0m0.147s time printf "continue\nsave-report\nquit\nk\n" | Debugger -c Debugger -s 1000 hoard2 real 0m2.295s user 0m2.505s sys 0m0.128s openbsd real 0m2.896s user 0m2.809s sys 0m0.579s The performance difference in Debugger is due to OpenBSD malloc actually decommitting memory. If we disable decommit, then OpenBSD malloc is faster than hoard2 in this case also. In some particular cases this is a huge speedup. For example, the link of the "lto-dump" program in GCC seems to hit a pathological case in hoard2 and our glue code for it; with hoard2 it takes around 23 seconds, but with this allocator it takes only 2 seconds (!). Overall the performance difference is much more modest, though. Overall, system memory usage seems to be up about ~5% (318 MB -> 334 MB just after boot), and that seems to mostly be due to the allocator filling its initial caches faster when allocations occur, rather than lazily allocating. Change-Id: I071d8f76fbbfa11547bd6da6bf649d111414e780 Reviewed-on: https://review.haiku-os.org/c/haiku/+/8974 Reviewed-by: waddlesplash Haiku-Format: Haiku-format Bot Tested-by: Commit checker robot --- src/system/libroot/posix/malloc/Jamfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/system/libroot/posix/malloc/Jamfile b/src/system/libroot/posix/malloc/Jamfile index 210cd21c86..2f1dab5608 100644 --- a/src/system/libroot/posix/malloc/Jamfile +++ b/src/system/libroot/posix/malloc/Jamfile @@ -1,4 +1,5 @@ SubDir HAIKU_TOP src system libroot posix malloc ; HaikuSubInclude debug ; -HaikuSubInclude hoard2 ; +#HaikuSubInclude hoard2 ; +HaikuSubInclude openbsd ;