Skip to content

Reduce overtime in relay_render_to_plane#11901

Open
noelle-lavenza wants to merge 2 commits intocmss13-devs:masterfrom
noelle-lavenza:fix/rrtp-overtime
Open

Reduce overtime in relay_render_to_plane#11901
noelle-lavenza wants to merge 2 commits intocmss13-devs:masterfrom
noelle-lavenza:fix/rrtp-overtime

Conversation

@noelle-lavenza
Copy link
Contributor

About the pull request

Instead of checking in screen in relay_render_to_plane, we check an alist that exists specifically for this purpose. This ensures we don't have to loop over the entire screen list searching for each relay. That saves a ton of overtime.

We also don't recreate the planemaster's relay if it already exists. This seems to have saved the rest of the overtime, because now it's extremely low per call.

Explain why it's good for the game

Reduces overtime from 1.93568 per 292193 calls to a projected 0.2783 per 292193 calls (actual numbers are 0.002/2100, so it could be slightly better in practice due to rounding).

With a second change, I was able to get it even lower: for spamming F12 to call show_hud() over and over again, it was 0.001/6755, which is 0.0433 overtime per call. When spamming aghost and Re-enter corpse, it actually had an overtime of 0 for 3465 calls, which is incredible. Everything looks fine as well!

I would feel most comfortable if this was testmerged, but it seemed alright in local testing, at least.

Testing Photographs and Procedure

Runtime map looks fine, stairs aren't broken, openspace isn't broken, darkness/lighting isn't broken.

Screenshots & Videos image image

Changelog

🆑 MoondancerPony
refactor: refactored plane render relay plate code to reduce overtime lag from observing and changing mobs
/:cl:

@github-project-automation github-project-automation bot moved this to Awaiting Review in Review Backlog Mar 7, 2026
@cmss13-ci cmss13-ci bot added Refactor Make the code harder to read size/M Denotes a PR that changes 50-199 lines, ignoring generated files. labels Mar 7, 2026
@cm13-github
Copy link
Contributor

cm13-github commented Mar 8, 2026

Test merge deployment history:

Test Merge Deployed @ 03/08/2026 21:49:07 +00:00:
Server Instance

CM13 Live

Revision

Origin: 864091c
Pull Request: ae81d26
Server: 2cbe3d2

Test Merge Updated @ 03/09/2026 00:45:51 +00:00:
Server Instance

CM13 Live

Revision

Origin: 0cbb7e5
Pull Request: ae81d26
Server: 5a97a35

Test Merge Updated @ 03/09/2026 01:12:33 +00:00:
Server Instance

CM13 Live

Revision

Origin: cb54193
Pull Request: ae81d26
Server: 65bf557fe0deb74cfe48d69e35e12ebcbc38c1e3

Test Merge Updated @ 03/09/2026 02:43:29 +00:00:
Server Instance

CM13 Live

Revision

Origin: 875069c
Pull Request: ae81d26
Server: 304d72e358bed79142ccd24e752bcac21660aa87

Test Merge Updated @ 03/09/2026 08:45:18 +00:00:
Server Instance

CM13 Live

Revision

Origin: d5dbcb1
Pull Request: ae81d26
Server: 614860872e31ec25e7abe5348e3da88099bf90f7

Test Merge Updated @ 03/09/2026 10:08:59 +00:00:
Server Instance

CM13 Live

Revision

Origin: d5dbcb1
Pull Request: ae81d26
Server: c7fa723

Test Merge Updated @ 03/09/2026 11:16:28 +00:00:
Server Instance

CM13 Live

Revision

Origin: 63fcc66
Pull Request: ae81d26
Server: 8b361c13bb30d51256efa45187562536ffd60f96

Test Merge Updated @ 03/09/2026 11:45:57 +00:00:
Server Instance

CM13 Live

Revision

Origin: 63fcc66
Pull Request: ae81d26
Server: fea05db

Test Merge Updated @ 03/09/2026 12:27:54 +00:00:
Server Instance

CM13 Live

Revision

Origin: 63fcc66
Pull Request: ae81d26
Server: 4bf1827

Test Merge Updated @ 03/09/2026 15:13:39 +00:00:
Server Instance

CM13 Live

Revision

Origin: 63fcc66
Pull Request: ae81d26
Server: b4e7703

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Make the code harder to read size/M Denotes a PR that changes 50-199 lines, ignoring generated files.

Projects

Status: Awaiting Review

Development

Successfully merging this pull request may close these issues.

2 participants