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

Re-add sync.map and optimise #1290

Closed
wants to merge 25 commits into from

Conversation

soujanyanmbri
Copy link
Contributor

@soujanyanmbri soujanyanmbri commented Jan 22, 2025

Thank you for contributing to Coraza WAF, your effort is greatly appreciated
Before submitting check if what you want to add to coraza list meets quality standards before sending pull request. Thanks!

Make sure that you've checked the boxes below before you submit PR:

Thanks for your contribution ❤️

@soujanyanmbri
Copy link
Contributor Author

soujanyanmbri commented Jan 22, 2025

Benchmarks:

BEFORE:
Running tool: /usr/local/go/bin/go test -benchmem -run=^$ -bench ^BenchmarkAddTransformationUnique$ github.com/corazawaf/coraza/v3/internal/corazawaf

goos: darwin
goarch: amd64
pkg: github.com/corazawaf/coraza/v3/internal/corazawaf
cpu: VirtualApple @ 2.50GHz
BenchmarkAddTransformationUnique-10    	  126936	    138391 ns/op	  619809 B/op	       4 allocs/op
PASS
ok  	github.com/corazawaf/coraza/v3/internal/corazawaf	19.698s
Running tool: /usr/local/go/bin/go test -benchmem -run=^$ -bench ^BenchmarkAddTransformationUnique$ github.com/corazawaf/coraza/v3/internal/corazawaf

AFTER:
goos: darwin
goarch: amd64
pkg: github.com/corazawaf/coraza/v3/internal/corazawaf
cpu: VirtualApple @ 2.50GHz
BenchmarkAddTransformationUnique-10    	 5864598	       330.3 ns/op	     240 B/op	       5 allocs/op
PASS
ok  	github.com/corazawaf/coraza/v3/internal/corazawaf	6.652s

This also takes care of concurrancy issues from here - #1197

CC: @piyushroshan @fzipi

Copy link

codecov bot commented Jan 22, 2025

Codecov Report

Attention: Patch coverage is 61.38614% with 39 lines in your changes missing coverage. Please review.

Project coverage is 81.62%. Comparing base (20f16ee) to head (3d5412c).

Files with missing lines Patch % Lines
internal/variables/variablesmap.gen.go 50.00% 26 Missing ⚠️
internal/corazawaf/transaction.go 8.33% 11 Missing ⚠️
internal/collections/named.go 93.10% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1290      +/-   ##
==========================================
- Coverage   81.76%   81.62%   -0.14%     
==========================================
  Files         169      169              
  Lines        9770     9849      +79     
==========================================
+ Hits         7988     8039      +51     
- Misses       1533     1561      +28     
  Partials      249      249              
Flag Coverage Δ
coraza.rule.case_sensitive_args_keys 81.58% <61.38%> (-0.14%) ⬇️
coraza.rule.multiphase_valuation 81.62% <61.38%> (-0.14%) ⬇️
coraza.rule.no_regex_multiline 81.56% <61.38%> (-0.14%) ⬇️
default 81.62% <61.38%> (-0.14%) ⬇️
examples+ 16.34% <1.98%> (-0.20%) ⬇️
examples+coraza.rule.case_sensitive_args_keys 81.58% <61.38%> (-0.14%) ⬇️
examples+coraza.rule.multiphase_valuation 81.45% <61.38%> (-0.14%) ⬇️
examples+coraza.rule.no_regex_multiline 81.48% <61.38%> (-0.14%) ⬇️
examples+memoize_builders 81.58% <61.38%> (-0.14%) ⬇️
examples+no_fs_access 80.91% <61.38%> (-0.14%) ⬇️
ftw 81.62% <61.38%> (-0.14%) ⬇️
memoize_builders 81.71% <61.38%> (-0.14%) ⬇️
no_fs_access 81.07% <61.38%> (-0.14%) ⬇️
tinygo 81.59% <61.38%> (-0.14%) ⬇️

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.

@soujanyanmbri soujanyanmbri marked this pull request as ready for review January 22, 2025 16:00
@soujanyanmbri soujanyanmbri requested a review from a team as a code owner January 22, 2025 16:00
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