News for hackers. Stuff that matters.
Re:Python 3.13 Gets a JIT by jiripospisil on Tuesday January 09, 2024 @06:59AM (#38925103)
Just for giggles I tried this and I'm getting ~200ms when reading and hashing 50MB file in the browser (Chromium based) vs ~120ms using Python 3.11.6.

https://gist.github.com/jiripospisil/1ae8b877b1c728536e382fc...

https://jsfiddle.net/yebdnz6x/

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...
Re:Python 3.13 Gets a JIT by jampekka on Tuesday January 09, 2024 @09:04AM (#38926290)
All major browsers have supported it for over eight years. Maybe the problem was between the seat and the keyboard?

https://caniuse.com/mdn-api_crypto_subtle

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".
Re:Python 3.13 Gets a JIT by ptx on Tuesday January 09, 2024 @03:38PM (#38931774)
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.

[0] https://github.com/w3c/webcrypto/issues/73