Skip to content

Commit 877100a

Browse files
committed
More performance tweaking
1 parent c728170 commit 877100a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/hires/HiresTileModel.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import de.bluecolored.bluemap.core.util.math.MatrixM4f;
3333
import de.bluecolored.bluemap.core.util.math.VectorM3f;
3434

35+
import java.io.BufferedWriter;
3536
import java.io.IOException;
3637
import java.io.OutputStream;
3738
import java.io.OutputStreamWriter;
@@ -390,7 +391,7 @@ public void writeBufferGeometryJson(OutputStream out) throws IOException {
390391
sort();
391392

392393
Gson gson = new GsonBuilder().create();
393-
JsonWriter json = gson.newJsonWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8));
394+
JsonWriter json = gson.newJsonWriter(new BufferedWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8), 81920));
394395

395396
json.beginObject(); // main-object
396397

BlueMapCore/src/main/java/de/bluecolored/bluemap/core/world/Block.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class Block<T extends Block<T>> {
3232
private Chunk chunk;
3333

3434
private BlockState blockState;
35-
private LightData lightData;
35+
private final LightData lightData = new LightData(-1, -1);
3636
private int biomeId;
3737

3838
public Block(World world, int x, int y, int z) {
@@ -74,7 +74,7 @@ public T set(int x, int y, int z) {
7474

7575
protected void reset() {
7676
this.blockState = null;
77-
this.lightData = new LightData(-1, -1);
77+
this.lightData.set(-1, -1);
7878
this.biomeId = -1;
7979
}
8080

@@ -92,7 +92,7 @@ public T copy(Block<?> source) {
9292
reset();
9393

9494
this.blockState = source.blockState;
95-
this.lightData = new LightData(source.lightData.getSkyLight(), source.lightData.getBlockLight());
95+
this.lightData.set(source.lightData.getSkyLight(), source.lightData.getBlockLight());
9696
this.biomeId = source.biomeId;
9797

9898
return self();

0 commit comments

Comments
 (0)