5 ms·
Ronsor [1] and reply by seproDev: > Why can't we embed a lightweight interpreter such as QuickJS? > @Ronsor #14404 (comment) The linked comment [2]: > @dirk
by bArray 1y ago
Ronsor [1] and reply by seproDev:
> Why can't we embed a lightweight interpreter such as QuickJS?
> @Ronsor #14404 (comment)
The linked comment [2]:
> @dirkf This solution was tested with QuickJS which yielded execution times of >20 minutes per video
How on earth can it be that terrible compared to Deno?
[1] https://github.com/yt-dlp/yt-dlp/issues/14404#issuecomment-3328565433 https://github.com/yt-dlp/yt-dlp/issues/14404#issuecomment-3...
[2] https://github.com/yt-dlp/yt-dlp/issues/14404#issuecomment-3325235277 https://github.com/yt-dlp/yt-dlp/issues/14404#issuecomment-3...
- jlokier 1y ago> How on earth can it be that terrible [>20 minutes] compared to Deno? QuickJS uses a bytecode interpreter (like Python, famously slow), and is optimised for simplicity and correctness. Whereas Deno uses a JIT compiler (like Java, .NET and WASM). Deno uses the same JIT compiler as Chrome, one of the most heavily-optimised in the world. That doesn't normally lead to such a large factor in time difference, but it explains most of it, and depending on the type of code being run, it could explain all of it in this case. QuickJIT (a fork of QuickJS that uses TCC for JIT) might yield better results, but still slower than Deno.
- ynx 1y agoJIT is still banned by policy on a LOT of mobile devices, meaning that previous usage of yt-dlp on mobile is now effectively unsupportable.
- SpaghettiCthulu 1y agoI haven't tested this, but in theory running deno with `--v8-flags='--jitless'`[^1][^2] will disable the JIT compiler. [^1]: https://v8.dev/blog/jitless https://v8.dev/blog/jitless [^2]: https://docs.deno.com/runtime/getting_started/command_line_interface/ https://docs.deno.com/runtime/getting_started/command_line_i...
- Klonoar 1y agoIf the performance drops due to lack of JIT, then GPs comment about effectively useless on mobile might still hold weight.
- int_19h 1y agoIt's probably a lot more than that. A well-optimized bytecode interpreter is not 100x slower than native code. But also e.g. QuickJS uses refcounting with the occasional tracing to remove cycles, and while it's a simple and reliable approach, it's not fast.
- 1317 1y agowell yt-dlp would also be banned surely? so it's not an issue anyway
- ynx 1y agonope, python can be interpreted!
- bArray 1y agoMy concern is either that QuickJS is something like 100x slower, or that even when using Deno, the download experience will be insanely slow. In my mind, an acceptable time for users might be 30 seconds (somewhat similar to watching an ad). If QuickJS is taking >20 minutes, then it is some 40x slower? Seems very high? > QuickJIT (a fork of QuickJS that uses TCC for JIT) might yield better results, but still slower than Deno. Interesting, not come across it before. Running C code seems like an insane workaround from a security perspective.
- ronsor 1y agoIt's horrifying and Google must've worked very hard to kill the performance in other interpreters.
- lucianbr 1y agoThe brightest minds (or something close) working hard to make computation slower and more difficult, so that someone can profit more.
- darknavi 1y agoThat is interesting. We use QuickJS in Minecraft (Bedrock, for modding) and while it's much slower than V8 it's not _that_ much slower.