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

Optimize "DisplayProcessTxDetails": Early exit if log level is not TRACE #6322

Merged
merged 3 commits into from
Jul 19, 2024

Conversation

andreibancioiu
Copy link
Collaborator

@andreibancioiu andreibancioiu commented Jul 17, 2024

Reasoning behind the pull request

  • The function DisplayProcessTxDetails is called in a few places during transactions processing. Its main concern is to display some data by means of Log.Trace(). In this regard, it performs some computation, which takes some non-negligible time (analyzed with pprof).

Proposed changes

  • Skip the computations performed by DisplayProcessTxDetails if it should display nothing, given the current log level.

Testing procedure

  • Standard testing.

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@andreibancioiu andreibancioiu self-assigned this Jul 17, 2024
@andreibancioiu andreibancioiu marked this pull request as ready for review July 17, 2024 16:02
Copy link
Collaborator

@danidrasovean danidrasovean left a comment

Choose a reason for hiding this comment

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

Normal allin test: v1.7.13-dev-config-aebb55e8e0 -> optimize-display-process-t-3b72d1056a

--- Specific errors ---

block hash does not match 1922
wrong nonce in block 860
miniblocks does not match 0
num miniblocks does not match 0
miniblock hash does not match 0
block bodies does not match 0
receipts hash missmatch 0

/------/

--- Statistics ---

Nr. of all ERRORS: 1
Nr. of all WARNS: 890
Nr. of new ERRORS: 1
Nr. of new WARNS: 10
Nr. of PANICS: 0

/------/

@danidrasovean danidrasovean merged commit a6d3565 into rc/v1.7.next1 Jul 19, 2024
8 checks passed
@danidrasovean danidrasovean deleted the optimize-display-process-tx-details branch July 19, 2024 07:15
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.

5 participants