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

Remove unnecessary ProgressBar stdout writes (fixes flickering) #30278

Merged
merged 1 commit into from Feb 17, 2019

Conversation

ostrolucky
Copy link
Contributor

@ostrolucky ostrolucky commented Feb 17, 2019

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

Currently ProgressBar flickers when writing a lot.

ezgif-4-ad817e1834

This patch fixes it and it's buttery smooth now.

Additionally, this improves performance by 60%. Test code

$maxSteps = 1000000;
$progressBar = new ProgressBar(new ConsoleOutput(), $maxSteps);
for ($i=0; $i<= $maxSteps; $i++) {
    $progressBar->advance();
}

Copy link
Member

@chalasr chalasr left a comment

Choose a reason for hiding this comment

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

Great :)

@fabpot
Copy link
Member

fabpot commented Feb 17, 2019

Thank you @ostrolucky.

@fabpot fabpot merged commit 3fbcb96 into symfony:3.4 Feb 17, 2019
fabpot added a commit that referenced this pull request Feb 17, 2019
…ring) (ostrolucky)

This PR was merged into the 3.4 branch.

Discussion
----------

Remove unnecessary ProgressBar stdout writes (fixes flickering)

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Currently ProgressBar flickers when writing a lot.

![ezgif-4-ad817e1834](https://user-images.githubusercontent.com/496233/38173299-44482400-35bc-11e8-88b6-83b480d55905.gif)

This patch fixes it and it's buttery smooth now.

Additionally, this improves performance by 60%. Test code
```php
$maxSteps = 1000000;
$progressBar = new ProgressBar(new ConsoleOutput(), $maxSteps);
for ($i=0; $i<= $maxSteps; $i++) {
    $progressBar->advance();
}
```

Commits
-------

3fbcb96 Remove unnecessary ProgressBar stdout writes (fixes flickering)
This was referenced Mar 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants