Repository navigation
perf: rewrite food on meat hooks, baking trays and troughs only when it would look different - #126
Draft
XxFran10xX wants to merge 3 commits into
Draft
XxFran10xX wants to merge 3 commits into
XxFran10xX wants to merge 3 commits into
Conversation
…it would look different The meat hook, baking tray and trough timers rebuilt and rewrote every food in their slots each second (model, lore, carve state, display item, hook display transform, furniture save) only to store the new clock and aged numbers. On Main at 15+ players that was ~11 s of main thread per hour (meat hooks alone 5.5 s/h). Food ages by the wall clock from its stored clock, values and remainder, so the slots now use the inventory scan's rule (FoodScan, #124): SlotAging writes a slot only for a new tag step, lost warmth, broken lore, a clock to set, or a rebuild that would differ (with the furniture's model), and otherwise leaves it resting until a second before it can next look different. Any change to the item ends the rest, as do /cooking reload and /iareload (ItemRef.clearCache). Food with a sauce keeps the old every-second rewrite. Carving reads the roast's numbers into the cuts and starts the roast left on the hook on a new clock, so it now ages the roast to now first; before, those numbers were at most a second old. Plates keep the old rewrite: adding a sauce copies the plated food onto a new clock and sauces only age when the food is rewritten. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… any thread Review: glazing relied on addOrModifyTrack aging the roast first; say it outright like carving does. forgetAll may run from the ItemsAdder load event, so it now moves a generation on instead of clearing the server thread's map. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review: aging the roast before the glaze checks changed fire-pit glazing (a roast gone off by the clock was refused); addOrModifyTrack already ages it before the glaze track goes on, as before. The tray timer used to mark baking trays dirty every second, which also saved the oven's per-slot bake time with the minute autosave; the oven now marks the tray itself while that time runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Meat hook, baking tray and trough timers rebuilt and rewrote every food in their slots each second (model, lore, carve state, display item, hook display transform, furniture save) only to store the new clock. On Main at 15+ players that was ~11 s of main thread per hour (meat hooks alone ~5.5 s/h, spark 11-04).
Food ages by the wall clock from its stored clock, values and remainder, so the slots now use the inventory scan's rule (FoodScan, #124):
SlotAgingwrites a slot only for a new tag step, lost warmth, broken lore, a clock to set, or a rebuild that would differ (with the furniture's model). Otherwise the slot rests until a second before it can next look different. Any change to the item ends the rest, as do/cooking reloadand/iareload.FoodScan.updatetakes the furniture id so the rebuild uses the furniture model.No gameplay or visible change intended.
Tests
SlotAgingTest: resting slots look exactly like the old every-second rewrite, with one write per visible change.🤖 Generated with Claude Code