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

filter-processor: Remove reflection #1468

Merged
merged 24 commits into from
Feb 17, 2023

Conversation

winder
Copy link
Contributor

@winder winder commented Feb 15, 2023

Summary

Next round of changes after #1463

  • merge ExactFilter and EqualToFilter
  • (bugfix) support matching regex special characters in "exact" string search.
  • searcher unit tests.
  • use type casting instead of reflection.

Test Plan

New unit tests and existing regression tests.

@codecov
Copy link

codecov bot commented Feb 15, 2023

Codecov Report

Merging #1468 (6f3b8c7) into develop (1ed87ae) will increase coverage by 1.01%.
The diff coverage is 52.94%.

@@             Coverage Diff             @@
##           develop    #1468      +/-   ##
===========================================
+ Coverage    64.69%   65.71%   +1.01%     
===========================================
  Files           84       84              
  Lines        11504    11467      -37     
===========================================
+ Hits          7442     7535      +93     
+ Misses        3493     3364     -129     
+ Partials       569      568       -1     
Impacted Files Coverage Δ
...filterprocessor/fields/generated_signed_txn_map.go 17.08% <15.38%> (ø)
...plugins/processors/filterprocessor/gen/generate.go 36.92% <35.71%> (+36.92%) ⬆️
...rocessors/filterprocessor/expression/expression.go 100.00% <100.00%> (+41.42%) ⬆️
...ilterprocessor/expression/numerical_expressions.go 59.01% <100.00%> (+37.27%) ⬆️
...gins/processors/filterprocessor/fields/searcher.go 77.77% <100.00%> (+2.10%) ⬆️
...ins/processors/filterprocessor/filter_processor.go 80.00% <100.00%> (-0.56%) ⬇️
idb/postgres/postgres.go 65.49% <0.00%> (-0.14%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@winder winder marked this pull request as ready for review February 16, 2023 01:55
@winder winder added the Enhancement New feature or request label Feb 16, 2023
Copy link
Contributor

@shiqizng shiqizng left a comment

Choose a reason for hiding this comment

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

lgtm

Comment on lines +404 to +412
func BenchmarkSearch(b *testing.B) {
exp, err := MakeExpression(EqualToFilter, "10", "")
require.NoError(b, err)

b.ResetTimer()
for i := 0; i < b.N; i++ {
exp.Search("11")
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

@winder winder merged commit 789fa06 into algorand:develop Feb 17, 2023
@winder winder deleted the will/filter-remove-reflection branch February 17, 2023 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants