Skip to content

Improve SQLite and map performance#63

Open
BryceStevenWilley wants to merge 2 commits intotechnosophos:masterfrom
BryceStevenWilley:perf_take_2
Open

Improve SQLite and map performance#63
BryceStevenWilley wants to merge 2 commits intotechnosophos:masterfrom
BryceStevenWilley:perf_take_2

Conversation

@BryceStevenWilley
Copy link

@BryceStevenWilley BryceStevenWilley commented Oct 1, 2022

Not sure if significant performance improvements are considered under maintenance. If not, feel free to close.

Inspired by #59, with profiling, was able to improve two points of performance:

  • use SQLite transactions to greatly speedup inserts
  • looking into the entities map. For most characters, we don't need to check the map, so added a quick comparison operator to improve that

On my general workload (generating a docset with 348 entities) on my machine, this improves
things from taking 35 seconds to things take 2 seconds. Most of the timesave was from the SQLite improvements.

Realizing that most of the changed lines here were organizing the entities map, which didn't make a difference except for in making the smallest rune clearer. Happy to revert that if desired.

With profiling, was able to improve two points of performance:
* use SQLite transactions to greatly speedup inserts
* looking into the entities map. For most characters,
  we don't need to check the map, so added a quick comparison
  operator to improve that

On my general workload + machine, this improves
things from taking 35 seconds to things take 2 seconds.
Most of the timesave was from the SQLite improvements.
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