mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-04 00:46:08 +00:00
20-30% performance increase
This commit is contained in:
parent
055ddc7c9b
commit
0fa9654824
@ -38,12 +38,14 @@ public class HeadlessPregenMethod implements PregeneratorMethod {
|
|||||||
private final Semaphore semaphore;
|
private final Semaphore semaphore;
|
||||||
private final int max;
|
private final int max;
|
||||||
private final World world;
|
private final World world;
|
||||||
|
private final MultiBurst burst;
|
||||||
|
|
||||||
public HeadlessPregenMethod(Engine engine) {
|
public HeadlessPregenMethod(Engine engine) {
|
||||||
this.world = engine.getWorld().realWorld();
|
this.world = engine.getWorld().realWorld();
|
||||||
this.max = IrisSettings.getThreadCount(IrisSettings.get().getConcurrency().getParallelism());
|
this.max = IrisSettings.getThreadCount(IrisSettings.get().getConcurrency().getParallelism());
|
||||||
this.engine = engine;
|
this.engine = engine;
|
||||||
this.headless = INMS.get().createHeadless(engine);
|
this.headless = INMS.get().createHeadless(engine);
|
||||||
|
burst = new MultiBurst("HeadlessPregen", 8 );
|
||||||
this.semaphore = new Semaphore(max);
|
this.semaphore = new Semaphore(max);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,7 +93,7 @@ public class HeadlessPregenMethod implements PregeneratorMethod {
|
|||||||
semaphore.release();
|
semaphore.release();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MultiBurst.burst.complete(() -> {
|
burst.complete(() -> {
|
||||||
try {
|
try {
|
||||||
listener.onChunkGenerating(x, z);
|
listener.onChunkGenerating(x, z);
|
||||||
headless.generateChunk(x, z);
|
headless.generateChunk(x, z);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user