reason
reason copied to clipboard
Refmt can be extremely slow
The issue start occuring when refmt is used on "many" files (> 500):

(Notice that I'm using the bsrfmt
wrapper in the screenshot above).
Tested on a mac pro, with 16go of ram and a [email protected].
Notice that this also has a pretty big impact on the extensions using refmt under the hood to reformat the files on save.
Do you have a repo with a case to reproduce this behaviour?
@gaku-sei is the total time more than the sum of the times, if files are formatted individually?
@gaku-sei Do you have the same behaviour when doing find -name '*.re' | xargs bsrefmt --in-place
?
Thank you guys for you replies. The above command (and the one submitted by @bloodyowl ) both give the same results. It's most of the time fast, around half a second, but sometimes go crazy (as above) for no reason 😕
Also, i thought it was the reason why vs code was hanging when saving a file (since the https://github.com/jaredly/reason-language-server extension runs refmt under the hood), but it could be related to an other issue: https://github.com/jaredly/reason-language-server/issues/423
@gaku-sei there must then be a couple of slow files. That would be a more concrete repro, than the whole 500.