Use jemalloc in standalone and add stats.
Description of Changes
This uses jemalloc in standalone instead of mimalloc, unless the target env is msvc. The main reason is that jemalloc exposes better stats, and has a way to do heap profiling. This PR doesn't set up profiling, but it does add stats on jemalloc's memory usage.
Expected complexity level and risk
- The risk here is that there could be an issue on some platforms.
Testing
This works on mac and at least some linux platforms.
I suspect we should probably figure out if there are any platforms that this won't work on, since we just went through the work to expand our platform support (https://github.com/clockworklabs/SpacetimeDB/issues/2415).
I guess alternatively we could wait to see if any users complain..
this broadly looks good to me, but I'm not very familiar with different allocator behavior or with the stats part of our code, so I wonder if we can get someone to review who's more confident.
Could you please run subscription benchmarks before/after as well as the update 10^6 benchmark before/after?
benchmarks please
Criterion benchmark results
Error when comparing benchmarks: Couldn't find AWS credentials in environment, credentials file, or IAM role.
Caused by: Couldn't find AWS credentials in environment, credentials file, or IAM role.
Callgrind benchmark in progress...