Okay, I can see that. The challenge, of course, is coming up with a standard API that won't make things janky when someone tries to hash a large buffer -- especially since the threshold of what constitutes "large" can vary by orders of magnitude depending on platform.
-
-
In that way, it's not *all* that different from I/O -- you're starting an operation that may (or may not) take a human-perceivable amount of time to complete. I mean, the main property of crypto hashes is that they're processor-intensive, so you'll always be near that threshold.
0 replies 0 retweets 0 likes -
It kind of is. For example, xxHash is roughly 32 times faster than SHA-256. The notion with cryptohashes is that you shouldn't be able to brute-force compute a preimage, so the operation can't be trivial.
0 replies 0 retweets 0 likes -
Looks like Promise overhead is on the order of 25 ms for V8 nowadays: https://v8.dev/blog/fast-async -- so... not much?
2 replies 0 retweets 0 likes -
Replying to @adambroach @fugueish and
"The above chart [which shows the 25ms you seem to be quoting] shows the doxbee benchmark, which measures performance of promise-heavy code." That's not just one Promise resolution.
1 reply 0 retweets 0 likes -
Sure, and if you're only invoking a single promise, execution time is negligible. I presumed we were discussing real-world impacts, not angels-dancing-on-a-pinhead tweaks.
1 reply 0 retweets 0 likes -
Replying to @adambroach @fugueish and
Your phrasing made
@fugueish come to the conclusion that "Promises aren’t even 60 FPS", which, reading you again more carefully, is I think the opposite of the conclusion that you wanted.0 replies 0 retweets 0 likes
For what it’s worth, I think async crypto is not the right choice in JS, for the same reason why it’s not the right choice in any other language.
-
-
I could see the case for async interfaces if crypto were always done by dedicated HW on the queue/fence model (like GPUs), but x86 HW crypto doesn’t work that way. (Not sure about how it works on ARM SoCs.)
0 replies 1 retweet 1 likeThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.