dotnet / dotnet/performance

GCPerfSym has high run-to-run variance

Open
#2,450 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
F#
Stars
773
Forks
301
Avg merge
6d 9h
Merged PRs (30d)
15

Description

Running GCPerfSym has a 30% variance in reported numbers on what should be identical back-to-back runs. This isn't acceptable for driving some kinds of analysis and studies.

The reported metric [final_fragmentation_bytes](url) is the worse:

run.0.out:final_fragmentation_bytes: 954032104
run.1.out:final_fragmentation_bytes: 968503072
run.2.out:final_fragmentation_bytes: 814763208
run.3.out:final_fragmentation_bytes: 892824192
run.4.out:final_fragmentation_bytes: 977400240
run.5.out:final_fragmentation_bytes: 1001449616
run.6.out:final_fragmentation_bytes: 912557840
run.7.out:final_fragmentation_bytes: 772030472
run.8.out:final_fragmentation_bytes: 889834808
run.9.out:final_fragmentation_bytes: 872788240

I'm running on Linux 22.04 with dotnet 6.0, having built coreclr from source with gcc 11, and having applied https://patch-diff.githubusercontent.com/raw/dotnet/runtime/pull/63408.patch

Tracing with strace, the dotnet runtime calls getrandom() once via glibc malloc setup. It reads /dev/urandom ~10 times, once to make a GUID, and at least once more to make crypto secure random bytes.

I'm' invoking gcperfsim using:

export DOTNET_ROOT=/mnt/robhenry/dotnet/profile.gcc11/runtime/.dotnet
export DOTNET_gcServer=1
export DOTNET_GCgen0size=1E00000
export DOTNET_GCNoAffinitize=0
export DOTNET_Thread_UseAllCpuGroups=1
export DOTNET_GCCpuGroup=1
/usr/bin/time \
/usr/bin/taskset 0xff \
../dotnet_load/gcperfsim//bin/Debug/net6.0/linux-arm64/publish/GCPerfSim \
-threadCount 3 \
-totalLiveGB 0.2 \
-totalAllocGB 4.0 \
-sohSurvInterval 30 \
-lohSurvInterval 0 \
-pohSurvInterval 0 \
-sohSizeRange 100-4000 \
-lohSizeRange 102400-204800 \
-pohSizeRange 100-204800 \
-sohPinningInterval 50 \
-lohPinningInterval 0 \
-sohFinalizableInterval 0 \
-lohFinalizableInterval 0 \
-pohFinalizableInterval 0 \
-allocType reference \
-testKind time \
-lohAllocRatio 10 \
-pohAllocRatio 20
![x86_64 0 GCPerfSym_PlotNorm](https://user-images.githubusercontent.com/4371939/169910797-94820a7a-4452-4f87-babb-6b574e458afd.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.