Skip to content

Performance Improvements #1120

Description

@kderme

As mentioned in #1119 there is an increase in the memory usage in db-sync. Sync time can also be improved.

Ideas for this

  • Removal of withdrawlal validation validateRewardWithdrawals. Since rewards seem to work properly we no longer need this.
  • Removal or simplification of validateEpochRewards. We can validate the number of rewards instead of summing them.
  • Investigate laziness in the Statement Cache of Persistent. Persistant caches all queries, which can result in a huge amount of memory of db-sync runs for long. Also the structures it uses are not strict.
  • Make all fields and states in db-sync strict.
  • Check strictness of LRU cache.
  • Investigate how we maintain the ledger state. Reading/Storing it to disk, apply it in a strict way. Keep a list of ledger states in a way that there is sharing of heap space.
  • Rewards and stake distribution come in chunks of variable length. Make sure we handle them and insert them in chunks of fixed length to avoid sudden memory increase.
  • Query the db for datum and scripts before inserting. This reduces the overhead of serialising the same scripts/datums multiple times.
  • ghc profiling
  • Remove Foreign Keys Remove Foreign Keys #1082
  • Removing unused keys/indexes Remove unused Indexes, Unique and Primary Keys #1087

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions