mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-06-05 08:31:39 +00:00
Util: Reduce number of PRNG output buffers
Random is either fast enough or it isn't.
This commit is contained in:
@@ -170,7 +170,7 @@ public class RouterContext extends I2PAppContext {
|
||||
// or about 2 seconds per buffer - so about 200x faster
|
||||
// to fill than to drain - so we don't need too many
|
||||
long maxMemory = SystemVersion.getMaxMemory();
|
||||
long maxBuffs = (SystemVersion.isAndroid() || SystemVersion.isARM()) ? 4 : 8;
|
||||
long maxBuffs = (SystemVersion.isAndroid() || SystemVersion.isARM()) ? 3 : 5;
|
||||
long buffs = Math.min(maxBuffs, Math.max(2, maxMemory / (21 * 1024 * 1024)));
|
||||
envProps.setProperty("prng.buffers", Long.toString(buffs));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user