Skip to content

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
mainfrom
perf/meat-hook-tick
Draft

XxFran10xX wants to merge 3 commits into
mainfrom
perf/meat-hook-tick

Conversation

@XxFran10xX

Copy link
Copy Markdown
Contributor

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):

  • 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). Otherwise the slot rests until a second before it can next look different. Any change to the item ends the rest, as do /cooking reload and /iareload.
  • Food with a sauce keeps the old every-second rewrite.
  • FoodScan.update takes the furniture id so the rebuild uses the furniture model.
  • Carving ages the roast to now before the cuts take its numbers (the roast left on the hook starts a new clock); before, those numbers were at most a second old.
  • The oven marks a baking tray dirty while its bake time runs, which the tray timer's per-second rewrite used to do for it.
  • 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.

No gameplay or visible change intended.

Tests

  • New SlotAgingTest: resting slots look exactly like the old every-second rewrite, with one write per visible change.
  • Carve aging test; skip tests for hook, tray and trough; oven save counts.
  • 4 shipped-config/asset tests fail on Windows on unmodified main too.

🤖 Generated with Claude Code

XxFran10xX and others added 3 commits November 5, 2026 11:41
…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>
@coderabbitai

coderabbitai Bot commented Nov 5, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@github-actions github-actions Bot added the size:L 100-499 effective changed lines (tests excluded in mixed PRs). label Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant