Skip to content

Conversation

@samsonasik
Copy link
Member

@samsonasik samsonasik commented Jul 6, 2025

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@gharlan
Copy link

gharlan commented Jul 6, 2025

Or maybe disable parallel mode automatically when using --kaizen option?

@samsonasik
Copy link
Member Author

that will defeat the purpose of parallel

@TomasVotruba
Copy link
Member

TomasVotruba commented Jul 6, 2025

This is quite confusing behavior. Documenting would only hide the wtfs.

We should find a way to pass counter between processes, so it works as described.

@samsonasik
Copy link
Member Author

samsonasik commented Jul 6, 2025

@TomasVotruba the issue is, we can't control counter on other process while counting its own current rule + 1 on specific file, only total after process each done we that we can validate, like process A already rule X, and process B already rule Y, which already counted 1 before the worker is done.

The possible solution is using cache, but I am not sure read + write implication is reliable for this.

@samsonasik
Copy link
Member Author

samsonasik commented Jul 6, 2025

Here the detail:

For example, with kaizen 1, with 2 workers work in parallel:

Worker 1 - process file1.php, file2.php, file3.php

process rule A, add +1 from 0, we don't know yet if Worker 2 has processed 1 rule unless worker are done first

Worker 2 - process file4.php, file5.php, file6.php

process rule B, add +1 from 0, we don't know yet if Worker 1 has processed 1 rule unless worker are done first


when Worker 1 and Worker 2 are done, we see that both rule A and rule B applied already on different files, we can only validate on next Worker 3 and so on with even with $postFileCallback but still needs after process was done first.

$postFileCallback = function (int $stepCount): void {
$this->symfonyStyle->progressAdvance($stepCount);
// running in parallel here → nothing else to do

@gharlan
Copy link

gharlan commented Jul 6, 2025

that will defeat the purpose of parallel

But the current behavior is defeating the purpose of the kaizen option. So I think when using explicitly the kaizen option, it is more important to actually get the desired kaizen behavior than to keep the performance of the parallel mode.

(Of course, it would be best if both worked together. But I also think that would be difficult.)

@TomasVotruba
Copy link
Member

@samsonasik What solution can you think of? However hacky. We'll start from there.

@samsonasik
Copy link
Member Author

@TomasVotruba I will try with cache

@samsonasik
Copy link
Member Author

@samsonasik samsonasik deleted the add-note-kaizen branch July 17, 2025 11:22
@github-actions
Copy link
Contributor

This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--kaizen not working when using withParallel()

4 participants