You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I also tried bundling this little repro for the browser and the problem doesn't manifest there either.
Basically through the course of executing that code we end up calling webcrypto.subtle.deriveBits twice, with identical arguments, reported below (but you can log these yourself by uncommenting the console.log in the repro), also asking Node to do very little work to begin with (just one iteration of the derivation function, not a million), and crucially as far as I can see there should be nothing else running concurrently that is blocking the main thread, but still the second execution in this specific scenario is always way slower than the first one, which seems symptomatic of some underlying issue in Node.
I think this is worth a look just because of the wild difference in performance between the two calls, but also since we are dealing with crypto stuff it's probably worth making sure we aren't messing up something important internally.
How often does it reproduce? Is there a required condition?
Always, just execute the code.
What is the expected behavior? Why is that the expected behavior?
The expected behavior is that calling the same function twice takes about the same amount of time basically.
It could be that the GC is triggered during the second call for some reason? But it seems unlikely that if that's the problem it would reproduce pretty much exactly every time, and also ~70ms spent on a GC for what? There are relatively few objects getting allocated here in the first place, at least in userland as far as I can see.
What do you see instead?
I see the second call always taking much longer, which shouldn't be happening.
Additional information
No response
The text was updated successfully, but these errors were encountered:
Version
22.2.0
Platform
Subsystem
No response
What steps will reproduce the bug?
Execute this:
I see the following output:
I also tried bundling this little repro for the browser and the problem doesn't manifest there either.
Basically through the course of executing that code we end up calling
webcrypto.subtle.deriveBits
twice, with identical arguments, reported below (but you can log these yourself by uncommenting the console.log in the repro), also asking Node to do very little work to begin with (just one iteration of the derivation function, not a million), and crucially as far as I can see there should be nothing else running concurrently that is blocking the main thread, but still the second execution in this specific scenario is always way slower than the first one, which seems symptomatic of some underlying issue in Node.I think this is worth a look just because of the wild difference in performance between the two calls, but also since we are dealing with crypto stuff it's probably worth making sure we aren't messing up something important internally.
How often does it reproduce? Is there a required condition?
Always, just execute the code.
What is the expected behavior? Why is that the expected behavior?
The expected behavior is that calling the same function twice takes about the same amount of time basically.
It could be that the GC is triggered during the second call for some reason? But it seems unlikely that if that's the problem it would reproduce pretty much exactly every time, and also ~70ms spent on a GC for what? There are relatively few objects getting allocated here in the first place, at least in userland as far as I can see.
What do you see instead?
I see the second call always taking much longer, which shouldn't be happening.
Additional information
No response
The text was updated successfully, but these errors were encountered: