PERF.AUD001

Decompress On Load on a long clip puts the whole decoded clip in memory

Warning Performance One-click fix (Pro)

Decompress On Load decodes an audio clip to raw PCM when it’s loaded and keeps it that way. Playback is then as cheap as it gets — no decode per frame — but the clip’s memory footprint is its uncompressed size, which for a Vorbis file is several times what’s on disk. It’s the right setting for short, frequent sounds. On anything longer it’s the most expensive load type Unity has.

What the scan looks at

Audio clips of 5 seconds or more whose Load Type is Decompress On Load, on the active build target’s settings. Short SFX are left alone — that’s exactly what this load type is for.

Why it costs you

Roughly: 44.1 kHz, 16-bit, mono PCM is about 88 KB per second, stereo about 176 KB. A 30-second stereo track is over 5 MB resident, compared with a few hundred kilobytes for the compressed source. Fifteen such clips and you’ve spent most of a mobile audio budget on data that is almost always idle.

The three load types, in the order you should reach for them:

Load TypeMemoryBest for
Decompress On LoadUncompressed sizeShort, frequent SFX (footsteps, gunshots)
Compressed In MemoryCompressed sizeEverything in the middle
StreamingA small bufferMusic, ambience, long VO

How to fix it by hand

Select the clip, set Load Type to Compressed In Memory in the importer (per platform if you override), and reimport. Decoding then happens during playback, which costs a little CPU per active voice — fine for a handful of concurrent sounds, worth measuring if you play dozens at once on a low-end phone.

For clips longer than about half a minute, skip straight to Streaming: see PERF.AUD002.

What PerfLint does about it

The finding names the clip and its length. Pro can switch the Load Type to Compressed In Memory from the row, individually or as a group — an importer change, so it’s reversible.

When to ignore it

A clip that’s 6 seconds long but retriggered constantly (a looping engine sound, a rapid-fire weapon) may genuinely want Decompress On Load, since decode cost is paid per voice. That’s a per-sound judgement call, which is why this is a Warning with a button rather than something applied for you.

Check your own project. The scan is free, runs entirely on your machine, and reports this rule with the exact assets that trip it — nothing is uploaded.

Install the free scanner See a sample report


Last reviewed · All rules