Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
needs: build-base-with-docker
strategy:
matrix:
allocator: [ff, fg, gd, hd, hm, iso, je, lf, lp, lt, mesh, mng, mi, mi2, nomesh, pa, rp, scudo, sm, sn, sg, tbb, tc, yal, tcg]
allocator: [ff, fg, gd, hd, hm, iso, je, lf, lp, lt, mesh, mng, mi, mi2, mi3, nomesh, pa, rp, scudo, sm, sn, sg, tbb, tc, yal, tcg]
testsuite: [allt]
# Used to provide a platform-specific predicate
predicate: [true, false]
Expand Down Expand Up @@ -97,4 +97,4 @@ jobs:
allocator=${{ matrix.allocator }}
benchs=${{ (contains('lt,lf,gd', matrix.allocator) && 'cfrac espresso barnes larson-sized mstress rptest gs lua') || ('fg' == matrix.allocator && 'cfrac espresso barnes gs lua') || 'allt' }}
repeats=1
cache-from: type=gha,scope=buildkit_${{ inputs.platform }}
cache-from: type=gha,scope=buildkit_${{ inputs.platform }}
18 changes: 14 additions & 4 deletions bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# Allocators and tests
# --------------------------------------------------------------------

readonly alloc_all="sys dh ff fg gd hd hm hml iso je lf lp lt mi mi-sec mi2 mi2-sec mng mesh nomesh pa rp sc scudo sg sm sn sn-sec tbb tc tcg mi-dbg mi2-dbg xmi xsmi xmi-dbg yal rmalloc"
readonly alloc_secure="dh ff gd hm hml iso mi-sec mi2-sec mng pa scudo sg sn-sec sg"
readonly alloc_all="sys dh ff fg gd hd hm hml iso je lf lp lt mi mi-sec mi2 mi2-sec mi3 mi3-sec mng mesh nomesh pa rp sc scudo sg sm sn sn-sec tbb tc tcg mi-dbg mi2-dbg mi3-dbg xmi xsmi xmi-dbg yal rmalloc"
readonly alloc_secure="dh ff gd hm hml iso mi-sec mi2-sec mi3-sec mng pa scudo sg sn-sec sg"
alloc_run="" # allocators to run (expanded by command line options)
alloc_installed="sys" # later expanded to include all installed allocators
alloc_libs="sys=" # mapping from allocator to its .so as "<allocator>=<sofile> ..."
Expand Down Expand Up @@ -133,6 +133,9 @@ alloc_lib_add "mi-dbg" "$localdevdir/mi/out/debug/libmimalloc-debug$extso"
alloc_lib_add "mi2" "$localdevdir/mi2/out/release/libmimalloc$extso"
alloc_lib_add "mi2-sec" "$localdevdir/mi2/out/secure/libmimalloc-secure$extso"
alloc_lib_add "mi2-dbg" "$localdevdir/mi2/out/debug/libmimalloc-debug$extso"
alloc_lib_add "mi3" "$localdevdir/mi3/out/release/libmimalloc$extso"
alloc_lib_add "mi3-sec" "$localdevdir/mi3/out/secure/libmimalloc-secure$extso"
alloc_lib_add "mi3-dbg" "$localdevdir/mi3/out/debug/libmimalloc-debug$extso"

xmidir="$localdevdir/../../mi"
if ! [ -d "$xmidir" ]; then
Expand Down Expand Up @@ -230,6 +233,9 @@ fi
if is_installed "mi2"; then
alloc_installed="$alloc_installed mi2-sec mi2-dbg" # secure mimalloc
fi
if is_installed "mi3"; then
alloc_installed="$alloc_installed mi3-sec mi3-dbg" # secure mimalloc
fi
if is_installed "hm"; then
alloc_installed="$alloc_installed hml" # hardened_malloc light
fi
Expand Down Expand Up @@ -387,8 +393,9 @@ while : ; do
echo ""
echo "allocators:"
echo " dh use dieharder"
echo " mi-dbg use debug version of mimalloc"
echo " mi2-dbg use debug version of mimalloc2"
echo " mi-dbg use debug version of mimalloc"
echo " mi2-dbg use debug version of mimalloc2"
echo " mi3-dbg use debug version of mimalloc3"
echo " ff use ffmalloc"
echo " fg use freeguard"
echo " gd use guarder"
Expand All @@ -404,6 +411,8 @@ while : ; do
echo " mi-sec use secure version of mimalloc"
echo " mi2 use mimalloc2"
echo " mi2-sec use secure version of mimalloc2"
echo " mi3 use mimalloc3"
echo " mi3-sec use secure version of mimalloc3"
echo " mng use mallocng"
echo " nomesh use mesh with meshing disabled"
echo " pa use PartitionAlloc"
Expand Down Expand Up @@ -649,6 +658,7 @@ function run_test_cmd { # <test name> <command>
sys) run_test_env_cmd $1 "sys" "SYSMALLOC=1" "$2" $i;;
mi-dbg) run_test_env_cmd $1 "mi-dbg" "MIMALLOC_VERBOSE=1 MIMALLOC_STATS=1 ${ldpreload}=$alloc_lib" "$2" $i;;
mi2-dbg) run_test_env_cmd $1 "mi2-dbg" "MIMALLOC_VERBOSE=1 MIMALLOC_STATS=1 ${ldpreload}=$alloc_lib" "$2" $i;;
mi3-dbg) run_test_env_cmd $1 "mi3-dbg" "MIMALLOC_VERBOSE=1 MIMALLOC_STATS=1 ${ldpreload}=$alloc_lib" "$2" $i;;
tbb) run_test_env_cmd $1 "tbb" "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$lib_tbb_dir ${ldpreload}=$alloc_lib" "$2" $i;;
*) run_test_env_cmd $1 "$alloc" "${ldpreload}=$alloc_lib" "$2" $i;;
esac
Expand Down
29 changes: 29 additions & 0 deletions build-bench-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ readonly version_lt=master # ~unmaintained since 2019
readonly version_mesh=master # ~unmaintained since 2021
readonly version_mi=v1.8.2
readonly version_mi2=v2.1.2
readonly version_mi3=v3.3.0
readonly version_mng=master # ~unmaintained
readonly version_nomesh=$version_mesh
readonly version_pa=main
Expand Down Expand Up @@ -92,6 +93,7 @@ setup_lt=0
setup_mesh=0
setup_mi=0
setup_mi2=0
setup_mi3=0
setup_mng=0
setup_nomesh=0
setup_pa=0
Expand Down Expand Up @@ -143,6 +145,7 @@ while : ; do
setup_lp=$flag_arg
setup_mi=$flag_arg
setup_mi2=$flag_arg
setup_mi3=$flag_arg
setup_pa=$flag_arg
setup_sn=$flag_arg
setup_sg=$flag_arg
Expand Down Expand Up @@ -213,6 +216,8 @@ while : ; do
setup_mi=$flag_arg;;
mi2)
setup_mi2=$flag_arg;;
mi3)
setup_mi3=$flag_arg;;
nomesh)
setup_nomesh=$flag_arg;;
pa)
Expand Down Expand Up @@ -272,6 +277,7 @@ while : ; do
echo " mesh setup mesh allocator ($version_mesh)"
echo " mi setup mimalloc ($version_mi)"
echo " mi2 setup mimalloc ($version_mi2)"
echo " mi3 setup mimalloc ($version_mi3)"
echo " mng setup mallocng ($version_mng)"
echo " nomesh setup mesh allocator w/o meshing ($version_mesh)"
echo " pa setup PartitionAlloc ($version_pa)"
Expand Down Expand Up @@ -763,6 +769,29 @@ if test "$setup_mi2" = "1"; then
popd
fi

if test "$setup_mi3" = "1"; then
checkout mi3 $version_mi3 https://github.com/microsoft/mimalloc

echo ""
echo "- build mimalloc3 release"

cmake -B out/release
cmake --build out/release --parallel $procs

echo ""
echo "- build mimalloc3 debug with full checking"

cmake -B out/debug -DMI_CHECK_FULL=ON
cmake --build out/debug --parallel $procs

echo ""
echo "- build mimalloc3 secure"

cmake -B out/secure -DMI_SECURE=ON
cmake --build out/secure --parallel $procs
popd
fi

if test "$setup_yal" = "1"; then
checkout yal $version_yal https://github.com/jorisgeer/yalloc
./build.sh -V
Expand Down
Loading