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: prepare partial evaluation at boot for better performances #394

Merged
merged 7 commits into from
Oct 24, 2024

Conversation

davidebianchi
Copy link
Member

@davidebianchi davidebianchi commented Oct 23, 2024

This PR will improve performance of query generation of more than x20, and it seems also the allow and response.

Here the before/after on my machine:

Before:

BenchmarkEvaluateRequest-10                                 4534            255834 ns/op          194671 B/op       3024 allocs/op
BenchmarkEvaluateRequestWithQueryGeneration-10               154           7485473 ns/op         4507957 B/op     112217 allocs/op
BenchmarkEvaluateResponse-10                                1639            702470 ns/op          486613 B/op       7980 allocs/op

After:

BenchmarkEvaluateRequest-10                                 5054            208840 ns/op          165831 B/op       2437 allocs/op
BenchmarkEvaluateRequestWithQueryGeneration-10              3505            339451 ns/op          241816 B/op       4309 allocs/op
BenchmarkEvaluateResponse-10                                2014            576589 ns/op          418976 B/op       6992 allocs/op

@davidebianchi davidebianchi added enhancement New feature or request performance labels Oct 23, 2024
@coveralls
Copy link

coveralls commented Oct 23, 2024

Pull Request Test Coverage Report for Build 11497740816

Details

  • 98 of 105 (93.33%) changed or added relevant lines in 5 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.06%) to 85.013%

Changes Missing Coverage Covered Lines Changed/Added Lines %
sdk/evaluator.go 7 8 87.5%
core/input.go 5 7 71.43%
core/partialevaluators.go 34 38 89.47%
Files with Coverage Reduction New Missed Lines %
sdk/evaluator.go 1 82.89%
Totals Coverage Status
Change from base Build 11483635708: -0.06%
Covered Lines: 2303
Relevant Lines: 2709

💛 - Coveralls

@davidebianchi davidebianchi marked this pull request as ready for review October 23, 2024 15:37
core/partialevaluators.go Outdated Show resolved Hide resolved
core/partialevaluators.go Outdated Show resolved Hide resolved
Copy link
Member

@fredmaggiowski fredmaggiowski left a comment

Choose a reason for hiding this comment

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

LGTM

core/opaevaluator.go Show resolved Hide resolved
@fredmaggiowski fredmaggiowski changed the title Prepare partial evaluation for better perf perf: prepare partial evaluation at boot for better performances Oct 24, 2024
@fredmaggiowski fredmaggiowski merged commit 686c4e0 into main Oct 24, 2024
11 checks passed
@fredmaggiowski fredmaggiowski deleted the feat/prepared-partial branch October 24, 2024 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants