Conversation
|
I think we should figure out exactly why RAND_bytes is so slow, and if it can't easily be fixed, maybe implement a more global wrapper for random reads that can benefit the whole process instead of just this one function. Perhaps we should have thread_local random buffers or something. |
This is what I had in mind as well, but I'm not sure if it would be "safe" to store pre-generated random values in JS heap to be used whenever it's needed. I've did a similar optimization in Node.js almost 3 years ago but blocked due to security concerns. nodejs/node#44661 |
CodSpeed Performance ReportMerging #5442 will improve performances by 8.17%Comparing Summary
Benchmarks breakdown
Footnotes
|
|
Actually I think we should merge these 2 pull-request since there are places where entrophysource does not exist, and in those areas batched requests are extremely valuable. |
|
Closing in favor of #5444 |
We don't need to call RAND_BYTES for each call. We can batch them to reduce the overhead and improve performance.