-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
promtool: Speed up checking for duplicate rules #9262
Conversation
e9b1e5d
to
6e446a2
Compare
@zecke thanks for this, looks good, but there's something strange with CircleCI build, could you merge main into this? |
4cdf5d9
to
8f28f28
Compare
I lowered the parallelism in circle-ci but now tests fail in code not touched and in go mod sanity checking. I am not sure whether this is related to my changes at all. Needless to say that building locally works. |
please revert your circleci changes. it is because you probably also have a circleci account. |
the last test failure was done with a run with SSH, so it might have been tampered somehow. |
Reverted. How can we proceed? How can I not associate this with my account? Okay. I was able to unfollow the project which makes the build work/pass. PTAL now. |
Introduce a basic test for checking for duplicate rules. Signed-off-by: Holger Hans Peter Freyther <holger@moiji-mobile.com>
Add a simple benchmark with a large number of rules. Signed-off-by: Holger Hans Peter Freyther <holger@moiji-mobile.com>
Trade space for speed. Convert all rules into our temporary struct, sort and then iterate. This is a significant when having many rules. Signed-off-by: Holger Hans Peter Freyther <holger@moiji-mobile.com>
Going to merge from my account as CircleCI seems unhappy with @zecke's account. (Per previous comments the tests did succeed, but it didn't post the status to github, so the required check wouldn't let me merge.) |
Running
promtool check config
on large rule files is rather slow. Improve this by adding a testcase, benchmark and changing the algorithm used to find duplicates.