-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PORTS] Garbage Collection Optimizations (#2435)
* Refsearch Info Injection (#78574) ## About The Pull Request Adds a proc that types can override to inject extra information into the refsearch This'll allow us to more easily track and deal with refs held by general datums, like callbacks. I've implemented a template example FOR callbacks, to provide an example and assist in solving future issues Done to help lumipharon from TGMC, they were having trouble with this case. This isn't perfectly optimized, but this proc has a LOT of issues just in general. Need to rework it to cut down on string churn someday * Optimizes Reftracking (Bigly) (Plus harddel fixes) (#80443) Alllright so reftracking is slow, really really slow. That's a problem for me, both because I want it to be fast so I can more efficiently torture players by running it on live, but also because it impedes both local and CI runs. So I've set out to micro optimize the DoSearchVar proc, one of the hottest in the game. I've done this in a few different ways. Removing redundant proc args Yeeting assoc arg setting (extra cost) Moving if statements around to prioritize the more common case Ignoring empty lists. Throwing our snowflake list checking into the sun (Background, byond has some special lists that cannot be accessed like an assoc list, trying to will lead to runtimes) The way we handle this involves inspecting their ref string, and it eats a LOT of time. Faster then to mark all the lists we know are special by var name, and then use try/catch to detect and silence anything that sneaks through (this is on the order of like 1/3 per run, kinda curious what they are tbh) Thanks to MSO for the idea for this btw. Removes the vars and logic that tied ref searching to clients. It's not how this code is used, and it slows everything else down for really no reason Added support for handing in a known "hanging reference" count, and then searching for that. This lets us early exit the ref search if we find everything we were looking for, which is REALLY powerful, and why I asked for refcount() in the first place. [Fixes some harddels w gulag stuff born of the 515 one way ref issues](tgstation/tgstation@046d7da) [Ensures proximity cameras clean their ref to their proximity datum if it's deleted](tgstation/tgstation@ff607e9) [Deleting a pipe connected via the gas_machine_connector datum to a machine should also delete that machine (harddel fix)](tgstation/tgstation@9eecca2) All this combined speeds up refsearching massively, on the order of hundreds of seconds, and makes it far less time consuming for both CI and running on live. I'll be bullying some servers semi soon, want to see what I can cut out. --------- Co-authored-by: LemonInTheDark <[email protected]>
- Loading branch information
1 parent
0bcae55
commit c00f89b
Showing
7 changed files
with
186 additions
and
124 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.