intellij-haskforce
intellij-haskforce copied to clipboard
Lag when typing in larger file
Hey,
I seem to have a serious lag when typing in a somewhat larger hspec test file. The file contains about 300 lines of code (much of those lines are taken by Data.Tree types that take part in the tests, so while I agree that the file is a bit too large, it's not really avoidable, and not everything are functions.).
Every time now when I try to add a new test to my current test suite (in other words, every 'it' I add to my current 'describe' step) I get an incredible lag. I type and it takes one second before the letter appears on the screen. I switched off the plugin and started typing and I didn't have that lag, so I assume it's the plugin. I have ghc-mod(i) 5.2.1.1 and hlint 1.9.13 configured.
Unfortunately, I cannot really share this code (wouldn't like the loss of IP here at work ;-)), so the only thing I can do is try to describe my problem and maybe somebody can post a few tests or checks that I can do over here and post the output of it.
Edit: I can for example also add that I don't see this behavior in a small(er) file, so I do think it's got something to do with the size of the file itself, in number of lines. Maybe that gives some more info as to why it could go wrong...
Kasper
This may have to do with the parser itself. To rule out a couple of things, you could try clearing the path to ghc-modi in the Haskell Tools settings and restarting IntelliJ. If the problem persists, clear the path to ghc-mod, and try again. You could repeat this again with hlint as well; however, I doubt hlint is a problem here.
Clearing those paths didn't really help, problem persists. So I guess your conclusion is that it has something to do with the parser, which sounds like something difficult to fix. I'll try to check out a big open source project and see whether I can reproduce it there so you have at the very least some code to base your research on.
Sounds good, thanks for the help. Sorry you are encountering the issue, I'll dig into it. I just ran into #100 today, which seems to be triggered by sources from http-conduit. There may be something useful in there.
Yes, well, I'm afraid I'll have to disappoint you with trying to reproduce this with for example the lens library. It doesn't seem to want to go as slow as my project, even with some of the bigger files of the lens library ( I do encounter very slight slow downs when I fill out the ghc-mod(i) and hlint stuff). So it might be even a little more complicated or subtle than I first thought. Of the top of my head I can say that the differences between both projects (mine and the lens library) seem to be that my directory structure is one level deeper (I use the 'maven style' organisation with src/main and src/test to contain my source and test code). Next to that, I encounter the problem right now mainly (only, actually) in a test file that does loads of hspec tests, and I do not import the hspec stuff qualified or so.
2014-12-17 8:26 GMT+01:00 Cary Robbins [email protected]:
Sounds good, thanks for the help. Sorry you are encountering the issue, I'll dig into it. I just ran into #100 https://github.com/carymrobbins/intellij-haskforce/issues/100 today, which seems to be triggered by sources from http-conduit. There may be something useful in there.
— Reply to this email directly or view it on GitHub https://github.com/carymrobbins/intellij-haskforce/issues/99#issuecomment-67286102 .
Okay, on my github you can clone the talisman-haskell project I have there, it's a little try-out project. If you switch to the haskforceTest branch and you then open the DungeonMasterTest.hs file, scroll completely to the bottom and then try to add a test (or just start typing, especially 'enter's ) you should encounter the slow down. Hopefully.
Wow, that's awesome, thanks for the time and work on this! I'll be digging in.
Note that I basically copied one test a gazillion times, so I don't know how much that skews the problem, but if at the very least you can already experience what I experience, it's a start :-)