-
Notifications
You must be signed in to change notification settings - Fork 643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use RANGE_TURFS #6692
Use RANGE_TURFS #6692
Conversation
This PR has been inactive for long enough to be automatically marked as stale. This means it is at risk of being auto closed in ~ 7 days, please address any outstanding review items and ensure your PR is finished, if these are all true and you are auto-staled anyway, you need to actively ask maintainers if your PR will be merged. Once you have done any of the previous actions then you should request a maintainer remove the stale label on your PR, to reset the stale timer. If you feel no maintainer will respond in that time, you may wish to close this PR youself, while you seek maintainer comment, as you will then be able to reopen the PR yourself |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell code is fine. It has been TM'd for a while without any issues seemingly. I also tested some of the more obscure things changed such as teleporter, bluespace tomatoes, and doors bordering space (or not) without issue.
About the pull request
Switches several uses of
for(var/turf/... in range())
over toRANGE_TURFS()
instead. Doesn't switch when the expected radius is less than 5. Where possible, removes the loop entirely.Explain why it's good for the game
For finding turfs,
RANGE_TURFS
shows a slight performance benefit overrange
. This performance benefit becomes more pronounced as the radius increases.Testing Photographs and Procedure
Screenshots & Videos
Performance testing. All procs in question return a list of turfs.

The procs of interest:
Radius 1:

Radius 5:

Radius 10:

Radius 20:

Results show that when able to convert away from a loop (
turftest_range_turf_direct
) that is always the best choice. For results under a radius of 5 the standardrange
(turftest_range
) was notably faster, for a radius of 5 or moreRANGE_TURFS
(turftest_range_turf
) was slightly faster.Changelog
No player facing changes.