isolateMinLength static method
The minimal length to encodeAsync in the compressionIsolatePool at
quality: Brotli is pure Dart, and a slow encoding would block the
event loop (and all the other requests of the isolate).
Starts at about 1.5ms of encoding (JSON, AOT): the pool workers keep
the encoder tables initialized, so an encoding costs about the same
in a worker as inline (a new isolate per encoding, like Isolate.run,
would add ~1.5ms at quality 6 and ~2.5ms at 9).
Implementation
static int isolateMinLength(int quality) {
if (quality >= 9) return 32 * 1024; // ~1.9ms inline.
if (quality >= 6) return 64 * 1024; // ~1.3ms inline.
return 256 * 1024; // ~1.2ms inline.
}