From 2ed6c3d1afbe33459cde8855299d3c327ffa30dc Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 20 Jul 2025 13:57:16 +0300 Subject: FreeBSD: enable dlmalloc by default (--enable-malloc-replacement) * After re-benchmarking the performance, I in fact detected a 20-25% speedup if memory limiting is active. Both using `time` and the builtin monotic timer ::^B. When memory limiting is disabled, there is no detectable difference to jemalloc. The following test case was used: sciteco -e '::^BUs 100000<@^U[^E\a]"^E\a" %a> ::^B-Qs=' * I also played around with getrusage(), but it doesn't seem to be a viable API for detecting the currently used RSS, i.e. it does not allow recovering from OOMs. --- configure.ac | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 8620050..7320ffe 100644 --- a/configure.ac +++ b/configure.ac @@ -410,10 +410,8 @@ AC_ARG_ENABLE(malloc-replacement, [malloc_replacement=$enableval], [malloc_replacement=check]) if [[ $malloc_replacement = check ]]; then # We currently do not support dlmalloc on Windows and Mac OS. - # It works on FreeBSD, but is slower than the polling fallback, - # it has been disabled by default. case $host in - *-*-*bsd* | *-*-darwin* | *-mingw*) malloc_replacement=no;; + *-*-darwin* | *-mingw*) malloc_replacement=no;; *) malloc_replacement=yes;; esac fi -- cgit v1.2.3