Lua Randomness Library

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Lua Randomness Library

Post by zorg »

pgimeno wrote: Sun Dec 16, 2018 12:16 pm The Linux kernel has one, but its throughput is slow. I made a test in which I got just under 600 MB of random numbers during about 5 years.
If anyone's curious, that would be about 0.95 Bytes per second. :3

Edit: apparently i can't divide 300 by 5 correctly, welp :P
Last edited by zorg on Sun Dec 16, 2018 2:54 pm, edited 1 time in total.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: Lua Randomness Library

Post by grump »

zorg wrote: Sun Dec 16, 2018 1:19 pm
pgimeno wrote: Sun Dec 16, 2018 12:16 pm The Linux kernel has one, but its throughput is slow. I made a test in which I got just under 600 MB of random numbers during about 5 years.
If anyone's curious, that would be about 0.95 Bytes per second. :3
Nah, it's ~3.8 bytes per second.

Much slower than I expected.
User avatar
pgimeno
Party member
Posts: 3550
Joined: Sun Oct 18, 2015 2:58 pm

Re: Lua Randomness Library

Post by pgimeno »

That's an average; it depends on the activity of the events that the kernel gathers entropy from. I've just measured the time it took to read a 1K block, three times in different conditions. With a download going on during the measurement, the throughput was about 12.6 B/s. By continuously moving my mouse and typing in the keyboard, I got about 4.5 B/s. By idling, but with some background network activity from IRC pings and whatnot, it was a bit under 0.35 B/s, or about 20 B/min.

Edit: I've installed the rng-tools5 package, which provides a rngd daemon that feeds the kernel's entropy pool, based on my CPU's RDRAND instruction (my CPU doesn't support RDSEED, which is the best one). Generation of 1KB is now in the ms range, if not faster (I can no longer measure it reliably).
Post Reply

Who is online

Users browsing this forum: No registered users and 81 guests