Skip to content

Conversation

@SirYwell
Copy link
Member

Overview

Description

Previously, the use of the vector api forced us to load get and set arrays eagerly. This also caused some overhead in e.g. heightmap recalculation because a set array was present even if no changes were applied to a chunk section.

By using a thin wrapper, we can delay loading the data (or load dummy data) to when it is actually needed. This reduces the mentioned overhead.

Performance difference isn't really noticeable from a user's perspective, as the overhead ran pretty much in parallel to the edit itself. Manually inspecting profiles shows that there is less work done though (especially visible when using //count). This might be more noticeable on busy servers or servers with only 2-4 cores.

### Submitter Checklist
- [x] Make sure you are opening from a topic branch (**/feature/fix/docs/ branch** (right side)) and not your main branch.
- [x] Ensure that the pull request title represents the desired changelog entry.
- [x] New public fields and methods are annotated with `@since TODO`.
- [x] I read and followed the [contribution guidelines](https://github.com/IntellectualSites/.github/blob/main/CONTRIBUTING.md).

@SirYwell SirYwell requested a review from a team as a code owner December 20, 2024 09:22
@github-actions github-actions bot added the Feature This PR adds a new feature label Dec 20, 2024
@NotMyFault NotMyFault requested a review from a team December 22, 2024 10:14
@NotMyFault NotMyFault merged commit 6a7aa96 into main Dec 24, 2024
9 checks passed
@NotMyFault NotMyFault deleted the feature/lazy-vectors branch December 24, 2024 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature This PR adds a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants