mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Performance Improvements
This commit is contained in:
parent
1c21b23e8e
commit
d3c47fe1a4
@ -90,7 +90,7 @@ public class HunkRegionSlice<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void save() {
|
public synchronized void save() {
|
||||||
BurstExecutor e = MultiBurst.burst.burst();
|
BurstExecutor e = MultiBurst.burstAux.burst();
|
||||||
for (ChunkPosition i : save.copy()) {
|
for (ChunkPosition i : save.copy()) {
|
||||||
if (i == null) {
|
if (i == null) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -25,16 +25,21 @@ import java.util.concurrent.ExecutorService;
|
|||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
|
|
||||||
public class MultiBurst {
|
public class MultiBurst {
|
||||||
public static final MultiBurst burst = new MultiBurst(Runtime.getRuntime().availableProcessors());
|
public static final MultiBurst burst = new MultiBurst("Iris Burster", 10, Runtime.getRuntime().availableProcessors());
|
||||||
|
public static final MultiBurst burstAux = new MultiBurst("Iris Aux Burster", 8, Runtime.getRuntime().availableProcessors()/2);
|
||||||
private final ExecutorService service;
|
private final ExecutorService service;
|
||||||
private ExecutorService syncService;
|
private ExecutorService syncService;
|
||||||
private int tid;
|
private int tid;
|
||||||
|
|
||||||
|
|
||||||
public MultiBurst(int tc) {
|
public MultiBurst(int tc) {
|
||||||
|
this("Iris Generator", 6, tc);
|
||||||
|
}
|
||||||
|
public MultiBurst(String name, int priority, int tc) {
|
||||||
service = Executors.newFixedThreadPool(tc, r -> {
|
service = Executors.newFixedThreadPool(tc, r -> {
|
||||||
tid++;
|
tid++;
|
||||||
Thread t = new Thread(r);
|
Thread t = new Thread(r);
|
||||||
t.setName("Iris Generator " + tid);
|
t.setName(name + " " + tid);
|
||||||
t.setPriority(6);
|
t.setPriority(6);
|
||||||
t.setUncaughtExceptionHandler((et, e) ->
|
t.setUncaughtExceptionHandler((et, e) ->
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user