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

perf(log): encode objects only when logged #481

Merged

Conversation

JeyJeyGao
Copy link
Contributor

@JeyJeyGao JeyJeyGao commented Nov 29, 2024

Fix:

  • replaced .String() with the %v format to avoid rendering the string before actually logging it.

Resolves #480

Signed-off-by: Junjie Gao <[email protected]>
@JeyJeyGao JeyJeyGao changed the title fix: log performance fix: logging performance Nov 29, 2024
Copy link

codecov bot commented Nov 29, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 80.39%. Comparing base (e99be19) to head (da2c926).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
notation.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #481   +/-   ##
=======================================
  Coverage   80.39%   80.39%           
=======================================
  Files          34       34           
  Lines        3330     3330           
=======================================
  Hits         2677     2677           
  Misses        508      508           
  Partials      145      145           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@Two-Hearts Two-Hearts left a comment

Choose a reason for hiding this comment

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

Please fix all occurrences in the library.

Nvm, looks like both files are covered.

@Two-Hearts Two-Hearts self-requested a review November 29, 2024 00:59
verifier/verifier.go Show resolved Hide resolved
verifier/verifier.go Show resolved Hide resolved
verifier/verifier.go Show resolved Hide resolved
verifier/verifier.go Show resolved Hide resolved
@Two-Hearts Two-Hearts self-requested a review November 29, 2024 01:02
@shizhMSFT shizhMSFT changed the title fix: logging performance perf: improve logging performance Nov 29, 2024
@shizhMSFT shizhMSFT changed the title perf: improve logging performance perf(log): encode objects only when logged Nov 29, 2024
Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@Two-Hearts Two-Hearts left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@priteshbandi priteshbandi left a comment

Choose a reason for hiding this comment

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

LGTM

@JeyJeyGao JeyJeyGao merged commit 95bac00 into notaryproject:main Dec 2, 2024
9 checks passed
JeyJeyGao added a commit to JeyJeyGao/notation-go that referenced this pull request Dec 9, 2024
Fix:
- replaced `.String()` with the `%v` format to avoid rendering the
string before actually logging it.

Resolves notaryproject#480

Signed-off-by: Junjie Gao <[email protected]>
JeyJeyGao added a commit to JeyJeyGao/notation-go that referenced this pull request Dec 9, 2024
commit ecd22a2
Author: Junjie Gao <[email protected]>
Date:   Tue Dec 3 06:19:18 2024 +0000

    fix: update comment

    Signed-off-by: Junjie Gao <[email protected]>

commit 32ae375
Author: Junjie Gao <[email protected]>
Date:   Mon Dec 2 09:10:37 2024 +0000

    fix: update

    Signed-off-by: Junjie Gao <[email protected]>

commit 0076d0f
Author: Junjie Gao <[email protected]>
Date:   Mon Dec 2 03:13:08 2024 +0000

    fix: update LimitedWriter

    Signed-off-by: Junjie Gao <[email protected]>

commit 067d4f6
Author: Junjie Gao <[email protected]>
Date:   Mon Dec 2 02:32:17 2024 +0000

    fix(test): update

    Signed-off-by: Junjie Gao <[email protected]>

commit 3099d35
Author: Junjie Gao <[email protected]>
Date:   Mon Dec 2 10:03:54 2024 +0800

    perf(log): encode objects only when logged (notaryproject#481)

    Fix:
    - replaced `.String()` with the `%v` format to avoid rendering the
    string before actually logging it.

    Resolves notaryproject#480

    Signed-off-by: Junjie Gao <[email protected]>

commit 8bc331b
Author: Patrick Zheng <[email protected]>
Date:   Mon Dec 2 08:30:56 2024 +0800

    fix: enable timestamping cert chain revocation check during signing (notaryproject#482)

    Signed-off-by: Patrick Zheng <[email protected]>
    Signed-off-by: Junjie Gao <[email protected]>

commit 161a736
Author: Junjie Gao <[email protected]>
Date:   Mon Dec 2 02:13:35 2024 +0000

    fix: resolve comments for Shiwei

    Signed-off-by: Junjie Gao <[email protected]>

commit 665e111
Author: Junjie Gao <[email protected]>
Date:   Fri Nov 29 08:07:16 2024 +0000

    fix: update code style

    Signed-off-by: Junjie Gao <[email protected]>

commit 5d6c89e
Author: Junjie Gao <[email protected]>
Date:   Fri Nov 29 08:06:15 2024 +0000

    fix: update comments

    Signed-off-by: Junjie Gao <[email protected]>

commit 3bc343d
Author: Junjie Gao <[email protected]>
Date:   Fri Nov 29 07:42:38 2024 +0000

    fix: update comment

    Signed-off-by: Junjie Gao <[email protected]>

commit 69303b5
Author: Junjie Gao <[email protected]>
Date:   Fri Nov 29 07:40:15 2024 +0000

    fix: limit the plugin output size

    Signed-off-by: Junjie Gao <[email protected]>

Signed-off-by: Junjie Gao <[email protected]>
Two-Hearts pushed a commit to Two-Hearts/notation-go that referenced this pull request Dec 9, 2024
Fix:
- replaced `.String()` with the `%v` format to avoid rendering the
string before actually logging it.

Resolves notaryproject#480

Signed-off-by: Junjie Gao <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Two-Hearts pushed a commit to Two-Hearts/notation-go that referenced this pull request Dec 9, 2024
Fix:
- replaced `.String()` with the `%v` format to avoid rendering the
string before actually logging it.

Resolves notaryproject#480

Signed-off-by: Junjie Gao <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
Two-Hearts pushed a commit to Two-Hearts/notation-go that referenced this pull request Dec 9, 2024
Fix:
- replaced `.String()` with the `%v` format to avoid rendering the
string before actually logging it.

Resolves notaryproject#480

Signed-off-by: Junjie Gao <[email protected]>
Signed-off-by: Patrick Zheng <[email protected]>
@Two-Hearts Two-Hearts mentioned this pull request Dec 12, 2024
6 tasks
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.

logging message performance needs to be improved
4 participants