Re:Python 3.13 Gets a JIT
by JodieBenitez on Tuesday January 09, 2024 @07:38AM
(#38925431)
Not so bad compared to what I tried a few years ago. Might finally be usable for us...
All major browsers have supported it for over eight years. Maybe the problem was between the seat and the keyboard?
Re:Python 3.13 Gets a JIT
by JodieBenitez on Tuesday January 09, 2024 @09:39AM
(#38926666)
Maybe 8 years is not much in a career ? Maybe we had to support one of those browsers that did not support it ? Maybe your snarky comment is out of place ? And even to this day it's still significantly slower than Python stdlib according to the tester. So much for "why python not as fast as js, python is slow, blah blah blah".
I thought that perhaps the difference could be due to the JavaScript version having to first read the entire file before getting started on hashing it , whereas the Python does it incrementally (which the browser API doesn't support [0]). But changing the Python version to work like the JavaScript version doesn't make a big difference: 30 vs 35 ms (with a ~50 MB file) on my machine.
The slowest part in the JavaScript version seems to be reading the file, accounting for 70–80% of the runtime in both Firefox and Chromium.
https://gist.github.com/jiripospisil/1ae8b877b1c728536e382fc...
https://jsfiddle.net/yebdnz6x/