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

Use plf linked list impl for shadowcasting #44512

Merged
merged 1 commit into from
Sep 30, 2020

Conversation

ifreund
Copy link
Contributor

@ifreund ifreund commented Sep 29, 2020

Summary

SUMMARY: Performance "Use plf linked list impl for shadowcasting."

Purpose of change

This linked list implementation has better performance characteristics than the standard library implementation and gives us a slight speedup for shadowcasting, where we can use all the performance we can get.

This is the last step towards resolving #6821 now that my and kevin's work in #32012 and #42835 has been merged. Further iteration on the 3d shadowcasting algorithm may be split into more specific issues, the core of the implementation is sound.

Closes #6821

Testing

Ran the test suite locally, tested in game without any noticeable bugs.

This linked list implementation has better performance characteristics
than the standard library implementation and gives us a slight speedup
for shadowcasting.
@kevingranade
Copy link
Member

Just out of curiosity, can you run tests/cata_test "shadowcasting_3d_2d_performance" on the before and after of this?
You probably want to open up tests/shadowcasting_test.cpp and knock a 0 off the iteration count of the benchmark, on my test system it was running for 30 minutes :/

@ifreund
Copy link
Contributor Author

ifreund commented Sep 30, 2020

I got:

before: cast_zlight() executed 100000 times in 757991174 microseconds. 
after: cast_zlight() executed 100000 times in 695576696 microseconds.

I also played around with naively splitting up the cast zlight_segment calls into multiple threads which didn't seem to immediately break things, could use more investigation.

@kevingranade kevingranade merged commit f08120b into CleverRaven:master Sep 30, 2020
@ifreund ifreund deleted the shadow-cata-list branch September 30, 2020 23:17
@anothersimulacrum anothersimulacrum added [C++] Changes (can be) made in C++. Previously named `Code` Code: Performance Performance boosting code (CPU, memory, etc.) labels Nov 8, 2020
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.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3-dimensional Z-level support, Core Part 3: FOV calculation. [$250]
3 participants