Skip to content

Don't de/serialize item components for NUTRIENT_OVERRIDE items. Add NUTRIENT_OVERRIDE to a bunch of grain items.#85587

Merged
dseguin merged 2 commits intoCleverRaven:masterfrom
akrieger:gritty
Feb 28, 2026
Merged

Don't de/serialize item components for NUTRIENT_OVERRIDE items. Add NUTRIENT_OVERRIDE to a bunch of grain items.#85587
dseguin merged 2 commits intoCleverRaven:masterfrom
akrieger:gritty

Conversation

@akrieger
Copy link
Member

Summary

Performance "Save map size by not serializing unnecessary item components."

Purpose of change

While debugging #85342 I noticed some excessively large map files. This was due to processed grains storing their entire chain of source items in their components tree. In the given debug save this was ~20% of the entire save.

Describe the solution

Add NUTRIENT_OVERRIDE to a bunch of grain processing items (wheat/barley/buckwheat/corn, to name a few), and then add an additional check to item::io to not de or serialize the components for items with flag_NUTRIENT_OVERRIDE.

Describe alternatives you've considered

Testing

Loaded and saved the large map tile in the linked issue, it shrank a lot (it was a storage shed on a farm with a ton of buckwheat and corn and barley).

Additional context

@github-actions github-actions bot added [JSON] Changes (can be) made in JSON Items: Food / Vitamins Comestibles and drinks [C++] Changes (can be) made in C++. Previously named `Code` Code: Performance Performance boosting code (CPU, memory, etc.) astyled astyled PR, label is assigned by github actions labels Feb 28, 2026
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added the json-styled JSON lint passed, label assigned by github actions label Feb 28, 2026
@dseguin dseguin merged commit 695d7ba into CleverRaven:master Feb 28, 2026
32 of 33 checks passed
@akrieger akrieger deleted the gritty branch February 28, 2026 20:05
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Code: Performance Performance boosting code (CPU, memory, etc.) Items: Food / Vitamins Comestibles and drinks [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants