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

Improve database module cache performance #19546

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adfoster-r7
Copy link
Contributor

@adfoster-r7 adfoster-r7 commented Oct 10, 2024

Improves the database module cache performance from ~3 minutes to ~1 by performing bulk inserts of module metadata instead of multiple smaller inserts for every module/reference/author/etc.

Verification

  • Open msfconsole
  • Open IRB when inside of msfconsole
  • Run the migration
  • Verify the cache is correctly populated into the database

Before

The multiple DB inserts for each record takes 100 or so seconds

>> framework.db.purge_all_module_details; puts 'updating'; _, elapsed_time = Rex::Stopwatch.elapsed_time { framework.db.update_all_module_details }; puts elapsed_time
190.257881

After

The DB inserts take a 1-2 seconds

>> framework.db.purge_all_module_details; puts 'updating'; _, elapsed_time = Rex::Stopwatch.elapsed_time { framework.db.update_all_module_details }; puts elapsed_time
76.59721399999944

@adfoster-r7 adfoster-r7 marked this pull request as ready for review October 16, 2024 22:22
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