Closed Voltir closed 8 years ago
As far as I can tell, each DSL in the type PRG = ... :|: FXNil
coproduct seems to exponentially impact the time it takes for Intellij to autocomplete an import. At 2-3 DSLs, its hardly noticeable, at 4 there is a bit of a stutter. At 5 it takes around a minute, and im worried what 6+ might look like.
Also, interestingly enough, if you limit each PRG to 3 DSLs and an FXNil
its possible to compose those with :||:
and get some performance back.. at least until you get to 9 DSLs -- I checked and :||:
seems to be effected in the same way :|:
is.
Yeah, I've got a service with 10 algebras composed and changes to that file take roughly 30 seconds to compile on my mpb. The proofing process with the types is fairly computationally intensive. I'm not sure how that'd be resolved - neither @mandubian or I use Intellij, so it's not quite so bad for us. Now I'm curious what a shapeless coproduct looks like with 10 types -- might be just as bad. I'll give it a shot and report back
@Voltir Could you make a PR with a sample with 6+ elements if you have one? Is it just in IDEA, how does it behave outside IDEA? (maybe there is something bad in the implicits order or precedence that can be improved)
adding the shapeless Coproduct with exactly the same types as my 10 item algebra increased the compile time of that file by 50% -- fairly non-scientific, but yeah I think that confirms that this kind of thing is just slow. @Voltir what happens when you do that same in Intellij?
On Wed, Jul 13, 2016 at 10:23 AM, Pascal Voitot notifications@github.com wrote:
@Voltir https://github.com/Voltir Could you make a PR with a sample with 6+ elements if you have one? Is it just in IDEA, how does it behave outside IDEA? (maybe there is something bad in the implicits order or precedence that can be improved)
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ProjectSeptemberInc/freek/issues/6#issuecomment-232370930, or mute the thread https://github.com/notifications/unsubscribe/AACCoeCVq6Q4ta3qAABd0hQXv-ARmA5Tks5qVPT4gaJpZM4JApTc .
I'm not really surprised, it's very intensive for compiler... I should try to re-use my type-dep FingerTree to see if it improves things ;)
I created a small reproducer here: https://github.com/Voltir/intellij-slowdown-example
As far as compile time is concerned, I haven't really noticed any problems - it may very well slow down with the size of the coproduct, but it certainly isnt taking minutes to compile, whereas Intellij is freezing for minutes when doing a relatively simple operation.
Im going to see if I can open an issue on intellij's side as well.
I created an issue on intellij's bug tracker here: https://youtrack.jetbrains.com/issue/IDEA-158518
since 0.5 it seems to have gotten significantly better - thanks!
Specifically, using the auto-import feature (Alt+Enter) seems to make intellij weep (that is, locking the UI for around a minute while it tries to figure out the right import). I only see this issue on the files that make use of freek macro. I wonder if I can disable some intellij functionality that might help with this particular problem.