John Davidson

php - Why is arc lint so slow?

0 comments
Message:


I am using arcanist and with a large number of linters both built-in and custom. As we add more, it's becoming increasingly slow.


For a beefy change with maybe an eslint expection, time arc lint shows it can take up to 30 minutes like so:


$ time arc lint
<...>
real 8m31.771s
user 17m53.159s
sys 4m52.329s

But on a clean repo with no changes, its fast


$ time arc lint
OKAY No lint warnings.

real 0m7.961s
user 0m6.763s
sys 0m1.363s

To figure out which linters are running slowly and should be optimized, I'd like to get more granular information about the runtime of each individual linter.


Currently


$ arc lint
Linting....
No Errors

Ideal state


$ arc lint
Linting eslint...
Elapsed time 18m38.311s
Linting with pylint...
Elapsed time 1m35.334s
Linting with local/
<...>
No Errors

So, how can I get more granular information from each individual arcanist linter?
(And otherwise, any tips and tricks for improving the run speed of arc lint?)



My Answer:
There are a few reasons why `arc lint` may be slow:

1. Number of linters: As you mentioned, having a large number of linters, both built-in and custom, can slow down the linting process. Each linter needs to run and analyze the code, which can add up in terms of time.

2. Complexity of the code: If the codebase is large and complex, the linters may take longer to analyze and provide feedback on the code.

3. Hardware limitations: If the machine running the linting process does not have enough resources (CPU, memory, etc.), it can slow down the process.

4. Network latency: If the linters need to fetch data from external sources (e.g. remote linters), network latency can also contribute to the overall slowness of the process.

To improve the speed of `arc lint`, you can try the following:

1. Disable unnecessary linters: If possible, disable any linters that are not essential for your project. This can help reduce the overall time it takes to run `arc lint`.

2. Optimize linter configurations: Check if there are any configurations for the linters that can be optimized to improve performance.

3. Upgrade hardware: If possible, run `arc lint` on a machine with better resources to improve the speed of the process.

4. Use caching: Some linters support caching results, which can help speed up subsequent runs of `arc lint`.

By taking these steps, you may be able to improve the speed of `arc lint` and make the linting process more efficient.

Rate this post

4 of 5 based on 3240 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us