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

fix(api): improve perf for /api/v1/app/dashboard #2966

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

Conversation

guybrush
Copy link
Collaborator

@guybrush guybrush commented Oct 9, 2024

found some parts that can run concurrently:

  • getSyncCommitteeStatistics: getExpectedSyncCommitteeSlots, getSyncCommitteeSlotsStatistics
  • getGeneralValidatorInfoForAppDashboard: the initial vali-query besides already existing routines
  • getValidatorExecutionPerformance: 3 concurrent routines vs everything at once

its hard to bench this but it should be a lot better since some parts are really heavy

here are some numbers to get a gist

WARN[0010] timingsObserver: getSyncCommitteeStatistics: total duration 1.554843646s
getSyncCommitteeSlotsStatistics: 1.554830162s
  getExpectedSyncCommitteeSlots: 1.510015578s 
WARN[0010] timingsObserver: getValidatorExecutionPerformance: total duration 2.678415806s
        getBlocks: 2.678294847s
   getPerformance: 916.856756ms
getFirstEpochTime: 282.770812ms 
WARN[0011] timingsObserver: getGeneralValidatorInfoForAppDashboard: total duration 3.665749851s
     GetCurrentDayClIncome: 3.665475577s
GetValidatorBalanceHistory: 947.228332ms
             getValidators: 920.865975ms
   GetLastAttestationSlots: 739.37852ms
                 aggregate: 11.996µs 
WARN[0011] timingsObserver: ApiDashboard: total duration 3.790604309s
getGeneralValidatorInfoForAppDashboard: 3.665851249s
      getValidatorExecutionPerformance: 2.678560807s
             getValidatorEffectiveness: 2.057824362s
            getSyncCommitteeStatistics: 1.554991527s
                getProposalLuckStats+1: 1.258281534s
               getRocketpoolValidators: 911.346472ms
     getSyncCommitteeInfoForValidators: 409.354864ms
                           getEpoch-10: 264.753654ms
                    getRocketpoolStats: 249.302946ms
                            getEpoch-1: 249.154268ms
   getSyncCommitteeInfoForValidators+1: 125.429342ms 
  • getSyncCommitteeStatistics would have taken 1.510015578s longer
  • getGeneralValidatorInfoForAppDashboard would have taken 920.865975ms longer
  • getValidatorExecutionPerformance would have taken 916.856756ms + 282.770812ms longer

@guybrush guybrush force-pushed the fix-api-perf-app-dashboard branch 2 times, most recently from a314fec to cd67727 Compare October 9, 2024 15:23
Copy link
Collaborator

@manuelsc manuelsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utack

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.

2 participants