Loading & Memory Benchmark Runner
Loading & Memory Benchmark Runner
Duration: 2 days
Platform: Editor & Android
Git: https://github.com/Ruslan1M/Loading-Memory-Benchmark-Runner.git
A small but very useful tool that automatically runs through scenes, measures loading time and peak memory usage, saves the figures in CSV format, and generates clear PNG graphics. It works both in Editor and on real devices (Android, etc.).
What it is. A tool for Unity that automatically runs through scenes, measures loading times (up to 90% and full activation) and memory peaks, saves CSV files and builds PNG graphics. Works in both Editor and on devices.
Why it matters. Long loading times and memory crashes are the top causes of mobile pain. You need repeatable figures, not one-off screenshots from the profiler.
How it works.
Two load times: Load90 and LoadDone. You can see where the bottleneck is — in streaming/IO or in activation (Awake/Start/initialisation).
Memory dynamics: Reserved/Allocated/Mono/System — measured every X ms, peak and steady-state are recorded separately.
Artifacts without unnecessary magic: metrics.csv with all samples and PNG graphics with curves.
Identical scenario on Editor and Player: comparable figures between branches/devices.
Why it’s useful.
One button → series of measurements → live table on top of the scene → folder with graphs and CSV, ready for PR/CI. The list of scenes is pulled from Build Settings automatically.
Memory sampling in Player (without editing APIs):
ProfilerRecorder _reserved, _mono, _systemUsed, _allocated;
public void Start()
{
_reserved = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Total Reserved Memory");
_allocated = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Total Used Memory");
_mono = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "GC Used Memory");
_systemUsed = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "System Used Memory");
}
public MemoryPoint Read()
{
double Mb(long bytes) => bytes / (1024.0 * 1024.0);
var p = new MemoryPoint
{
allocatedMB = _allocated.Valid ? Mb(_allocated.LastValue) : 0,
reservedMB = _reserved.Valid ? Mb(_reserved.LastValue) : 0,
monoMB = _mono.Valid ? Mb(_mono.LastValue) : 0,
systemUsedMB = _systemUsed.Valid ? Mb(_systemUsed.LastValue) : 0
};
return p;
}