Skip to content

Discard the recipe digestion map after firing the event#69

Open
embeddedt wants to merge 1 commit intoVazkiiMods:mainfrom
embeddedt:recipe-crawl-ram-usage-v2
Open

Discard the recipe digestion map after firing the event#69
embeddedt wants to merge 1 commit intoVazkiiMods:mainfrom
embeddedt:recipe-crawl-ram-usage-v2

Conversation

@embeddedt
Copy link

This is a faster & simpler alternative to #68 that simply discards the contents of the map after firing ZRecipeCrawl.Digest instead of trying to compact them for long-term storage.

A defensive copy is made before providing the multimaps to the event; this is for backwards compatibility in case there are mods that just store a reference to the map and assume they can work off of it till receiving the event again. If preserving that behavior is not a requirement, the defensive copy can be removed.

The memory savings should be at least as good as #68 if not better, as now the map doesn't need to be kept in memory long-term at all. In ATM9 this saves about 400MB of memory. 👀

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.

1 participant