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

Optimize electric grid #1461

Merged

Conversation

SaintCirno9
Copy link
Contributor

Summary

SUMMARY: [Performance] "Optimize electric grid"

Purpose of change

To fix #1322

Describe the solution

The profiler result in #1322 is rather inaccurate because of the compile options we use, I guess.
In fact, the major performance eater in electric_grid_at is the copy of the tripoint_abs_omt, which is weird.
Simply using a reference there solves the lag.

Describe alternatives you've considered

Testing

Load the save attached in #1322 , then walk around.

  • Before this PR
    before

  • After this PR
    after

Additional context

I also made the distribution_grid_tracker::on_saved() only reload needed things, but the improvement is not as significant as the reference used in electric_grid_at.

@Coolthulhu Coolthulhu self-assigned this Apr 19, 2022
@Coolthulhu Coolthulhu merged commit 4ca2725 into cataclysmbnteam:upload Apr 20, 2022
@SaintCirno9 SaintCirno9 deleted the electric-grid-performance branch April 24, 2022 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

strange lags in specific place
2 participants