Reduce stuttering with fast world gen
This commit is contained in:
+1
-1
@@ -69,7 +69,7 @@ public class DhDataOutputStream extends DataOutputStream
|
||||
arrayCache.reset();
|
||||
// Note: if the LZMA2Options are changed the array cache may need to be re-tested.
|
||||
// the array cache was specifically tested and tuned for LZMA preset 3/4
|
||||
return new XZOutputStream(stream, new LZMA2Options(3),
|
||||
return new XZOutputStream(stream, new LZMA2Options(3),
|
||||
XZ.CHECK_CRC64, arrayCache);
|
||||
|
||||
default:
|
||||
|
||||
+20
-4
@@ -63,8 +63,16 @@ public class LzmaArrayCache extends ArrayCache
|
||||
{
|
||||
return new byte[size];
|
||||
}
|
||||
// the array needs to be cleared to prevent accidentally sending dirty data
|
||||
Arrays.fill(array, (byte)0);
|
||||
|
||||
// the array only sometimes needs to be cleared,
|
||||
// clearing all the time results in unnecessary slowdowns
|
||||
if (fillWithZeros)
|
||||
{
|
||||
// TODO it appears that this can prevent the CPU from working on
|
||||
// other tasks, thus causing render thread lag even when run on a separate thread
|
||||
Arrays.fill(array, (byte) 0);
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
@@ -107,8 +115,16 @@ public class LzmaArrayCache extends ArrayCache
|
||||
{
|
||||
return new int[size];
|
||||
}
|
||||
// the array needs to be cleared to prevent accidentally sending dirty data
|
||||
Arrays.fill(array, (byte)0);
|
||||
|
||||
// the array only sometimes needs to be cleared,
|
||||
// clearing all the time results in unnecessary slowdowns
|
||||
if (fillWithZeros)
|
||||
{
|
||||
// TODO it appears that this can prevent the CPU from working on
|
||||
// other tasks, thus causing render thread lag even when run on a separate thread
|
||||
Arrays.fill(array, (byte) 0);
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user