-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Add unit tests/performance tests. #867
Comments
Hey @7sharp9, yes Fantomas isn't that fast when the files become larger. |
I was surprised the 800 lines took 4 seconds, most formatters don't have a perceivable latency. Benchmark.net is good for analysing but the functions that comprise fantomas would have to be tested in sections to see which parts are slow. |
Biggest performance issue right now is Trivia collecting and querying. https://github.com/fsprojects/fantomas/blob/master/src/Fantomas/Trivia.fs |
The filter, map, choose can be combined to avoid extra iterations, as choose is the map+filter optimisation. Not sure if thats a slow bit though :-) |
Slowest thing is probably that we use |
First thing I guess is to get a baseline with benchmark.net |
Ok, I'll try to set up a baseline with benchmark.net. |
If performance is a concern, you should restructure using of list piping in all the private query functions and potentially use an optimised tree structure as suggested already. Using streaming source/sink pattern is more performant but cannot use compiler hack on list creation head first |
Profiling with Perfview will show where time is being spent, what is allocating heavily, just collect, run, stop and find process in profile export |
Isn't preview a windows tool? I mean, who uses windows? |
😂 I do, it was that or a MBP 😷 😜 |
@7sharp9 could you share that example file of 800 lines you talked about? |
I'm going to close this as our benchmark test is in place and we can say that overall the performance has improved. |
Im finding that formatting takes ~4 seconds for an 800 line file it would be great to know the areas that are slowing things down so this could be improved. Im finding myself not wanting to use fantomas as I know I have to wait every time I use it. Similar tools in Elm,Go or Rust are instantaneous and it would be great to know where to aim improvements in this library.
The text was updated successfully, but these errors were encountered: