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

refactor: kaspad/src/daemon.rs #653

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

miningexperiments
Copy link
Contributor

Problem

fn create_core_with_runtime is a massive monolithic function

Fixes

  • Attempted to modularize the code by dividing the code into more functions
  • Added some optimizations to reduce function calls such as is_empty(), use of references
  • Few minor runtime optimizations such as using inverted gigabyte to reduce runtime calculations.

Tests

  • Tested to work with cargo test --release, cargo nextest r --release
  • cargo test non-release still has usual suspects 250k vec
  • Ran with --reset-db flag, which reset db
  • Ran in testnet10 without problems

Additional notes

  • There some todo notes left in the function, not sure of the status of these

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