Skip to content

Optimize the config saving, by using "Bulk Saving" method instead.#107

Open
AALUND13 wants to merge 1 commit intoRounds-Modding:mainfrom
AALUND13:main
Open

Optimize the config saving, by using "Bulk Saving" method instead.#107
AALUND13 wants to merge 1 commit intoRounds-Modding:mainfrom
AALUND13:main

Conversation

@AALUND13
Copy link

Summary

This change disables the config SaveOnConfigSet during Unbound initialization, and performs a single save after Unbound is fully loaded.

Implementation

  • Set config.SaveOnConfigSet = false at startup to prevent per-bind saves.
  • After Unbound is fully loaded, schedule a one second save
    this.ExecuteAfterSeconds(1, () =>
    {
        config.Save();
        config.SaveOnConfigSet = true;
    });

Performance Impact

Tested with a 117 mods modpack (019c86b6-941f-216a-a5c1-8ed4ceb102c4).

  • Baseline: 99,388 ms average startup time
  • With change: 46,563 ms average startup time
  • ~50% reduction in startup time (≈2.1× faster)

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.

1 participant