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

Pint is too slow #299

Closed
Zen0x7 opened this issue Oct 8, 2024 · 3 comments
Closed

Pint is too slow #299

Zen0x7 opened this issue Oct 8, 2024 · 3 comments

Comments

@Zen0x7
Copy link

Zen0x7 commented Oct 8, 2024

Pint Version

1.18

PHP Version

8.3

Description

I just install pint in a old laravel project that was upgraded to version 11, anyways, that's not the point, when ran the command, was too slow ...

2024-10-08.15-43-42.mp4

Yeah, video quality stinks but it's something that just happens.

I'm not pretty sure what is going on but the truth is that some files in my code contains a huge amount of array elements. Yup, so ... probably is something about that, IMHO isn't a huge problem but the point is, there a way to run pint in parallel? similar like when you're compiling some C/C++ and use -j<threads> or even can be like --parallel from testing, but maybe can be considered as overthink, anyways, if there are projects affected they can reduce their CI pipelines by doing that.

Steps To Reproduce

  1. Create a repo from scratch.
  2. Add a bunch of classes in the same folder.
  3. Declare array attribute in every class.
  4. Push 2000 array elements, ideally with 2 elements, inside that array.
  5. See what happens when you ran pint.
class Stuff {
    $array = [
         [1,2],
         [1,2],
         [1,2],
         [1,2],
         ...
    ]
}
Copy link

github-actions bot commented Oct 9, 2024

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

@danielh-official
Copy link

How big is your project? A big project is going to take a longer time than a smaller project to format.

You may run pint on specific sections of your project, if that helps: https://laravel.com/docs/11.x/pint#running-pint

e.g., ./vendor/bin/pint app/Models

@Zen0x7
Copy link
Author

Zen0x7 commented Oct 30, 2024

@crynobone @danielh-official I'll close this ticket as isn't a relevant issue, mainly because, once pint fix the file, the process takes only microseconds to check the file again.

And that point about --parallel sounds fancy but is a overthink, can be good if you have a big project but just checking a file and fix the code style cannot be compared with parallel testing (specially when tests can takes a long time when they run one by one).

Thanks all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants