-
Notifications
You must be signed in to change notification settings - Fork 119
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
Slower than usual with 100% CPU since 0.6.5 #181
Comments
Can you provide some code that demonstrates this issue? |
@weavejester unfortunately no as the code where it happens is private 😢 |
@weavejester actually I can exhibit the same behaviour on aleph. So you can checkout this branch https://github.com/rborer/aleph/tree/standard-cljfmt which uses 0.6.4. Bumping 0.6.6 into On 0.6.4: While on 0.6.6 I have: Hope it helps? |
I've the same problem: >3 Min 100% CPU on a current MacBook pro and a 4.5k line clj file. |
Any plan to have it released soon so I can confirm the fix is working on my side? Thanks. |
This patch addresses the slowdown introduced between 0.6.4 and 0.6.5 and fixes weavejester#181. Prior to this patch, find-namespace and ns-form? called z/sexpr on all traversed forms. The find-namespace logic needed only parts of resulting sexprs. The cost of z/sexpr was non-negligible when invoked on complex forms. As a result, z/sexpr and nested functions dominated the CPU cost of the indentation logic. This patch makes z/sexpr calls more fine-granular and avoids invoking the function on nodes irrelevant to find-namespace. This results in a tenfold speedup.
Hi,
I have multiple projects where version 0.6.4 worked perfectly fine and since I switched to version 0.6.5 (and 0.6.6), the process is taking much more time to format the code while the CPU is at 100%.
On one of my project here is the time difference:
16.42s user 0.41s system 111% cpu 15.037 total
358.01s user 1.01s system 102% cpu 5:50.29 total
Here is a stacktrace when this happens:
Also here is the process command (it is started through leiningen):
Finally, my java version:
I am a bit lost as to how to diagnose this issue 😕 . Does this ring a bell to someone? Let me know if the information I provided are enough to investigate or not.
Thanks,
Reynald
The text was updated successfully, but these errors were encountered: