x4e / PaperBin

An experiment at improving the performance of PaperMC
Other
96 stars 8 forks source link

Feature Request: Faster RNG #18

Closed not-ivy closed 3 years ago

not-ivy commented 3 years ago

According to Apache's website here,

Commons RNG provides implementations of pseudo-random numbers generators that are either faster or of higher quality (and sometimes both) than java.util.Random.

Here is a related patch: https://github.com/YatopiaMC/Yatopia/blob/f8c5c21e381f4f8573e76f52a9f96666b3fbf219/patches/removed/server/0061-Use-faster-random-implementation.patch

I'm just too lazy to do it ¯\(ツ)

x4e commented 3 years ago

Thank you for the suggestion.

Unfortunately, randomness is pretty much a feature in minecraft - map generation, loot spawns, mob spawns, critical hits and more, and I know many of my users do not want this to be affected. Sadly this alternative random you are suggesting does not produce the same randomness as Java's random.

Even if this were the case however, java's default random is already very fast and does not inflict any noticeable peformance impact on minecraft. As such I don't think it's necessary to change with random minecraft uses.