samedi 1 octobre 2022

PRNG allocation in Julia

Why is there extra allocation when a PRNG is given a seed, and how to "predict" the extra allocated memory? Example:

julia> @time a = Xoshiro()
  0.000018 seconds (1 allocation: 48 bytes)
Xoshiro(0xd53e541e5a9e5ee2, 0xa3e78308cafca7d8, 0x0e01f41edd308fda, 0x40f1d70265fa1fe0)

julia> @time a = Xoshiro(1234)
  0.000009 seconds (7 allocations: 512 bytes)
Xoshiro(0x9951797c85a704f1, 0xb9d66be14dfba82b, 0xb170153285fd9556, 0xe90a07f7bdd1fd77)



Aucun commentaire:

Enregistrer un commentaire