-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Process filter string once instead of per test #3615
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
Process filter string once instead of per test #3615
Conversation
|
I tried dropping this into our test suite, and it looks like a promising way forward, but the perf is still the same because the cost is in the pattern matching, not splitting on ':' (and I did confirm by the profile that I'm running your code). But I think this is a good base for implementing the set suggestion to fix the algorithmic complexity issue. |
|
Yeah, your suggestion may improve the performance but the Big O complexity will be the same, since the glob matching algorithm is O(N) which in terms of complexity is no different than normal string matching, this fix rather tackles the Big O complexity and improves that. |
With recent bot spams I'm not sure if this is a spam or a legitimate mod, @derekmauro @dinord can you follow up on on this? I think further discussion should take place on the issue rather than this merge request, since this merge request obviously does not aim to fix every issue in the repository but rather part of it. I think suggestion for other fixes should go into the issue and be handled on later merge requests (if not related to the current one). |
|
It's O(n^2) (n=number of tests) if one is running all the tests by using filters naming each test across different invocations of the testsuite. By making a set of non-glob strings, then it reduces to O(n) (O(1) lookup per test name) assuming your number of processes is fixed (for example because you have one per CPU) |
|
I'm not sure if I understand you correctly. You want to use a hashmap like data structure to do O(1) access to the tests that are named exactly, rather than doing a O(n*n) string matching? That works, not sure though if that's going to be considered common use to get accepted as a merge request (if mods agree that it is a good way to improve performance looks like that can be handled in an other merge request). |
|
Hey, just wanted to ping this PR for review. @dinord |
|
@derekmauro @dinord wanted to ping so that this merge request doesn't go stale. |
|
Apologies for the delay, we'll begin reviewing this shortly. |
|
Pinging again. Honestly this is extremely odd that a merge request takes 5 weeks. |
dinord
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat.
03d2d86 to
a5a8d83
Compare
|
@dinord requested changes are applied. |
a5a8d83 to
8666894
Compare
|
@dinord The main branch is failing, and I do not think the failure in the CI is on my part. Also I have applied the requested changes. |
|
Wanted to ping again. |
|
Is any one actually reviewing this code? |
|
We are reviewing it. However, there are issues with how this proposed change interacts with our internal codebase (even after the latest commit). |
|
Ah ok, it would be nice to provide some feedback. Since I try to actually be helpful and proceed with requested changes as early as possible. Thanks for the response. |
dinord
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I released a bunch of internal test cases for the matching logic in 97a4675.
Make sure to rebase and run against them.
|
Thanks for the review will read soon and apply changes accordingly. |
8666894 to
3b3d289
Compare
cbf0763 to
0a00006
Compare
|
@dinord Requested changes are applied, and the newly added tests pass. I want your confirmation on the last open discussion. |
0a00006 to
63fd91f
Compare
|
@dinord Any other issues to be concerned about? |
|
Happy new year, any hopes of getting this merged this year :D |
63fd91f to
29bc520
Compare
|
@dinord Should I continue pinging this? or there is no hopes of getting this merged? Are there more internal errors? |
@IYP-Programer-Yeah There's no activity in this repository for the last 14 days, not only your PR is unmerged but there are other PRs as well, likely because the engineers are not able to devote time here but it's been 2 weeks so there are chances that they will be coming here soon :). You have to be patient :). |
|
Thanks for addressing all the comments. I've started the import process once again. Hopefully we'll get this PR merged early next week. |
Fixes #3614
Improve filter performance by removing extra string processing that is performed for each test that can rather be performed only once per execution .