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

avoid executing costly With if noop logger #1015

Merged
merged 1 commit into from
Mar 15, 2024

Conversation

noboruma
Copy link
Contributor

@noboruma noboruma commented Mar 13, 2024

Prior to that change, Noop logger would execute With function for no benefits.

When running rule evaluation at high scale, the number of memory allocation sky rockets (~300MB / min at 1k RPS). This change proposes to make sure the logger is active before executing costly With function.

Prior to that change, Noop logger would execute With function for no
benefits.
Copy link

codecov bot commented Mar 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.13%. Comparing base (4ff1f76) to head (024d6be).
Report is 18 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1015      +/-   ##
==========================================
+ Coverage   82.72%   83.13%   +0.41%     
==========================================
  Files         162      162              
  Lines        9080     7556    -1524     
==========================================
- Hits         7511     6282    -1229     
+ Misses       1319     1026     -293     
+ Partials      250      248       -2     
Flag Coverage Δ
default 83.13% <100.00%> (+5.30%) ⬆️
examples 83.13% <100.00%> (+56.70%) ⬆️
ftw 83.13% <100.00%> (+35.77%) ⬆️
ftw-multiphase 83.13% <100.00%> (+33.59%) ⬆️
tinygo 83.13% <100.00%> (+7.73%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@jcchavezs jcchavezs requested a review from anuraaga March 13, 2024 17:26
@jcchavezs
Copy link
Member

Looks very reasonable to me.

@noboruma noboruma marked this pull request as ready for review March 14, 2024 00:37
@noboruma noboruma requested a review from a team as a code owner March 14, 2024 00:37
Copy link
Member

@jcchavezs jcchavezs left a comment

Choose a reason for hiding this comment

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

LGTM

@jcchavezs jcchavezs merged commit 0af085c into corazawaf:main Mar 15, 2024
9 checks passed
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