Skip to content

Commit

Permalink
Adjust the starting capacity of the queues
Browse files Browse the repository at this point in the history
  • Loading branch information
Desoroxxx committed Dec 7, 2023
1 parent 37c2b0e commit 2345335
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

### Changed

- Stopped using `PooledLongQueue` using `LongArrayFIFOQueue` instead, should be more optimized (Lower memory usage, faster & lighter lighting updates)
- Stopped using `PooledLongQueue` using `LongArrayFIFOQueue` instead, should be more optimized (faster & lighter lighting updates)
- Skip spreading light neighbor checks early if the current light is lower than the neighbor light
- Made minor changes to clamping (Shouldn't cause a difference)

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/dev/redstudio/alfheim/lighting/LightingEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,17 @@ public LightingEngine(final World world) {
this.world = world;
profiler = world.profiler;

initialBrightenings = new LongArrayFIFOQueue(128);
initialDarkenings = new LongArrayFIFOQueue(128);
initialBrightenings = new LongArrayFIFOQueue(16384);
initialDarkenings = new LongArrayFIFOQueue(16384);

for (int i = 0; i < EnumSkyBlock.values().length; ++i)
lightUpdateQueues[i] = new LongArrayFIFOQueue(128);
lightUpdateQueues[i] = new LongArrayFIFOQueue(16384);

for (int i = 0; i < darkeningQueues.length; ++i)
darkeningQueues[i] = new LongArrayFIFOQueue(128);
darkeningQueues[i] = new LongArrayFIFOQueue(16384);

for (int i = 0; i < brighteningQueues.length; ++i)
brighteningQueues[i] = new LongArrayFIFOQueue(128);
brighteningQueues[i] = new LongArrayFIFOQueue(16384);

for (int i = 0; i < neighborInfos.length; ++i)
neighborInfos[i] = new NeighborInfo();
Expand Down

0 comments on commit 2345335

Please sign in to comment.