Open xvrh opened 1 week ago
yes, because I switched it to CryptoRNG by default, it now probably waits longer for entropy, or has to do a bit more work to make it crypto strong.
If you with to revert to the old speed and behavior, you can use Uuid(goptions: GlobalOptions(MathRNG())
to set it globally. Or use v4(options: V4Options(rng: MathRNG()))
to do it at the function level.
You are also recreating the Uuid
object every time. you might get performance benefits if you create it once, and then run the v4()
function of the created object in the loop.
var uuid := const Uuid();
for (...) {
var uuidv4 = const uuid.v4();
}
The way you have it might be burning through entropy faster, because each Uuid creation, reseeds from scratch, instead of just getting more seed when necessary.
Thanks for the response.
I don't think your idea of putting the const Uuid()
out of the loop have any impact. Since it's a const object, it doesn't change the performance.
Anyway, I'll use the GlobalOptions
for now.
With the new version of this package, all our tests were slowed down by a big factor.
Here is a benchmark comparing the new and old version
On macOS: With version 4.4.2:
Elapsed 0:00:00.376794
With version 4.5.1:Elapsed 0:01:02.359221
On linux it is sligtly better With version 4.4.2:
Elapsed 0:00:00.400237
With version 4.5.1:Elapsed 0:00:11.670186
Maybe the OS is waiting to collect some entropy with the new rng algorithm?