Skip to content
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

Eliminate last get_vehicle call when vehicles are idle. #31903

Merged
merged 1 commit into from
Jun 27, 2019

Conversation

kevingranade
Copy link
Member

Summary

SUMMARY: None

Purpose of change

More profiling. There was one remaining call to get_vehicles() per turn in vehmove, even if no vehicles were even present.

Describe the solution

Replace the initial call to get_vehicles() in vehmove() with manually accessing the vehicle cache.
Subsequent retrievals of vehicles must still use get_Vehicles(), but the first one can use the cache.

@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` Code: Performance Performance boosting code (CPU, memory, etc.) Vehicles Vehicles, parts, mechanics & interactions labels Jun 27, 2019
@ZhilkinSerg ZhilkinSerg merged commit 91022b0 into CleverRaven:master Jun 27, 2019
@kevingranade
Copy link
Member Author

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/vehicles-cant-accelerate/20574/3

@kevingranade kevingranade deleted the minnowptization branch December 16, 2019 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Performance Performance boosting code (CPU, memory, etc.) Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants