CraftBook Build #4951

This is not a stable download!

We recommend the use of released versions whenever possible.

View Stable Downloads
ProjectCraftBook
StatusSUCCESS
Branchmaster
Number#4951-9424f86
Date14 hours ago
Artifacts

Sponsor
Apex Hosting
Changes
IDSummaryCommitterDate
9424f868
  • Fast path for self-triggered IC thinks (#1379)
    • Fast path for self-triggered IC thinks Every self-triggered IC paid for a full sign snapshot (getState), component serialization of all four lines and an IC id regex match on every think tick, even though the IC instance itself is cached. At 2000 STs that measured +3.4ms per tick with spikes to 100ms. The think handler now reuses the cached IC and family directly and only reruns the full setupIC verification once a second per IC; entries are only honoured while the IC remains in ICManager's cache, so break/unload invalidation is unchanged, and a sign edit is picked up within a second. Chunk-loaded lookups in the ST sweep are also memoised per pass, since clustered STs ask about the same few chunks thousands of times and a chunk cannot load or unload mid-sweep. Re-measured: 2000 active STs are indistinguishable from an idle server (50.5ms avg tick vs 50.3 baseline).
    • Drop the chunk-loaded memoisation isChunkLoaded is already a cheap map lookup on modern servers, so the cache traded one lookup for two plus boxing. The measured win came from skipping the sign snapshot and regex, which stays.
    • Use a Guava cache for the think fast path Review feedback: clearing the whole map at the limit churns every entry to make room for one, and on a server above the limit that puts every IC back on the slow path in waves - the cost the fast path exists to avoid. CacheBuilder with maximumSize evicts one entry instead, and expireAfterWrite replaces the hand-rolled deadline, so the value is just the ICFamily rather than an Object[] with a timestamp to unbox and compare. Guava caches are already used this way in ItemSyntax and ParsingUtil. Comment trimmed to what it is.
59487370+rasmuskd@users.noreply.github.com14 hours ago