-
Notifications
You must be signed in to change notification settings - Fork 37
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
Topiary is pretty slow on formatting OCaml codebases #525
Comments
In the stand-up meeting of today we mentioned the idea to have |
Somehow, this reminds me of As another random idea, if we really wanted to be able to have
or maybe have
but I am really not convinced by this. Again, just throwing them in here. |
I think it's time to think about subcommands. There could be a subcommand Then we could have Would this avoid the complications? |
I think this has been solved by subcommands. In the same repository $ time topiary format $(find -name '*.ml')
real 0m0.795s
user 0m1.058s
sys 0m0.026s |
Describe the bug
This issue is unrelated to #519. Topiary takes about half a second to format OCaml files, even trivial ones. This is reasonable when formatting one file but it becomes very frustrating when formatting a whole code base.
To Reproduce
For instance, on a relatively small codebase, with the latest version compiled in release mode:
Expected behavior
I would expect Topiary to be reasonably fast to format a whole code base (maybe a few seconds). This could be achieved either by having Topiary be very fast (probably under 100 ms) on separate files or by having Topiary able to process several files at once.
Environment
Additional context
The situation has already been improved a bit by #523 and its 40% speedup. However, one would need a much more drastic speedup per run to achieve something nicer.
If this helps, I'd imagine a command line interface of:
(or
-i
for short) handling at least one file (and failing if none were passed), or:(or
-f
and-o
for short) handling exactly one file and defaulting to stdin and stdout without any flags.Such an interface would also make for a much easier use in
find
/xargs
and inpre-commit
or similar utilities that expect formatters to handle several files at once.The text was updated successfully, but these errors were encountered: