-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Run Task related refactoring #7696
Conversation
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
@elaihau |
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 smoke tested
- configured tasks
- detected tasks
- customized detected tasks
- task dependencies
and they worked properly.
Thank you Roman !
I think changes looks good. Not sure about the motivation. Is it performance optimisation? Usually we test them by looking at numbers before and after to understand whether refactoring is worth it. |
yes, the PR allows to:
|
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 have not measured anything, but changes sound reasonable.
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
a5367f9
to
195154c
Compare
@akosyakov I had 3 points for
I had only 2 points for my branch because |
So, you can see that: For a For a For both According to the screenshots above you can see that we have huge time for getting workspace tasks - about 600-800 ms. So we should consider if we can reduce this time and improve our code. p.s. I think that measurement depends on number of @akosyakov @elaihau |
I need to have these changes merged to continue investigate and detect delay at running tasks, so I'm merging this PR. But we can continue to discuss here the result of the measurement. |
@RomanNikitenko if I understand the reasoning correctly, the idea is that if we have a detected task, we will look for a customization for that task anyway, so it doesn't matter whether we find the customized task or the contributed task...it will result in the same task being executed, right? |
There were two improvements:
First one has influence on all
Regarding
Sorry, I don't have a ready answer... |
What it does
1. Change the order of search task configuration at running
At the moment at running a task the order of search is:
provided
/detected
tasksconfigured
taskscustomized
tasksIt works and sure it founds the corresponding config for running.
The problem is: it does extra requests when it tries to find a
configured
task configuration.Let's say user runs some
configured
task:provided
tasks firstcached
provided taskconfigured
task amongprovided
tasks, so it tries to get all provided tasksprovided
tasksconfigured
tasksI think we can change the order and do search among
configured
tasks first. It will allow to avoid extra requests: it just check if a task exists in map - we don't readtasks.json
file at this step, so it can not slow down a search.So:
configured
task, it finds the corresponding config and do not search amongprovided
tasksprovided
task, it just check if a task exists in map, then it tries to find amongprovided
tasks2. Separate running a compound task
At the moment for any task config we do extra logic related to running a compound task.
But on the next step we need it if a task is compound only.
My propose is: separate this logic in another method and execute it if it's really required.
How to test
It's just refactoring, so we should avoid a regression.
configured
taskdetected
taskcompound
taskFor
compound
tasks testing I used intasks.json
file configurations like:Review checklist
Reminder for reviewers