My decoder runs best with shared-memory multithreading which requires certain headers to be set. Setting them isn't hard but they aren't on by default, so, my question: how should my library behave?
1. Throw an error if the headers aren't set, forcing the user to engage with the problem. To fall back to the slow path, they must set an option explicitly.
2. Automatically fall back to the slow path but show a warning in the console. Less friction, but users might miss the warning entirely and get only a fraction of the potential maximum performance.
After adding shared-memory multithreading to my ProRes decoder, it now decodes a 130-frame 1080p video in ~200ms, right in the browser.
This is 3x faster than multithreaded NATIVE FFmpeg, and 60% faster than Apple's hardware ProRes decoder.
Relentless optimization pays off :)