Repository navigation
Conversation
…r frames ServiceBag:SetInitFrameBudget(seconds) makes Init and Start wait a frame whenever the current frame has already spent the budget, so a large bag no longer initializes in one long frame. Order is unchanged and a service that yields in its own Init still errors. GetFrameBudgetStats reports how many frames were waited and the longest stretch of work. On a client with ~150 services this turned a 260 ms join frame into stretches of at most ~51 ms (budget 0.012).
…e budget set A service whose Init errored was reported as having yielded and stopped the rest of Init, and if it errored after a budget pause, Init never returned. Init is now caught, so an error is reported the same way as without a budget and the bag carries on. GetFrameBudgetStats also returns 0 for the stretch before Init has run.
This was referenced Oct 24, 2026
This branch had an error being deployed
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.
Adds
ServiceBag:SetInitFrameBudget(seconds), which makesInitandStartwait a frame whenever the current frame has already spent the budget, so a bag with many services no longer initializes in one long frame. Dependencies still initialize first, and a service that yields in its ownInitstill errors. Timed withos.clockin a Studio playtest on a desktop PC (a client with ~150 services, two runs each): without a budget,InitandStartran for 206–211 ms in a single frame; with a budget of 0.012 the longest stretch was 47–49 ms over 10–11 frames, though the bag finishes later (about 1.8 s instead of 0.2 s) because other join work shares those frames.