Skip to content

implement caching for getNetworks function#1599

Merged
rubensworks merged 1 commit intoCyclopsMC:master-1.21-ltsfrom
DaRacci:performance-fix
Feb 7, 2026
Merged

implement caching for getNetworks function#1599
rubensworks merged 1 commit intoCyclopsMC:master-1.21-ltsfrom
DaRacci:performance-fix

Conversation

@DaRacci
Copy link
Copy Markdown
Contributor

@DaRacci DaRacci commented Feb 7, 2026

Instead of constructing a new immutable collection, that is wrapping a new hash set copy multiple times every tick the immutable set gets cached and only recreated upon changes that dirty the master set.

This improves the total time spent each tick and also a major memory improvement.

Before changes
Time spent per tick image
Memory Allocation per second & Total over 5 minutes image
Post changes
Time spent per tick image
Memory Allocation per second & Total over 5 minutes image

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Feb 7, 2026

CLA assistant check
All committers have signed the CLA.

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 45.159% (+0.07%) from 45.087%
when pulling 7e5adf9 on DaRacci:performance-fix
into cd718d8 on CyclopsMC:master-1.21-lts.

@rubensworks rubensworks merged commit 44476ee into CyclopsMC:master-1.21-lts Feb 7, 2026
3 checks passed
@rubensworks
Copy link
Copy Markdown
Member

Nice, thanks @DaRacci. Very impactful for servers with many networks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants