Skip to content
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

Speed up checking #111

Closed
ndmitchell opened this issue May 6, 2017 · 10 comments
Closed

Speed up checking #111

ndmitchell opened this issue May 6, 2017 · 10 comments

Comments

@ndmitchell
Copy link

Having experimented with checking in VS Code, versus having the Idris interactive editor open, I found the interactive editor for :r was instant, but the Idris plugin is pretty slow. Is that because it's reloading from scratch each time? Any way to speed it up?

@zjhmale
Copy link
Owner

zjhmale commented May 7, 2017

Hi, @ndmitchell Currently there is no reload command in Idris IDE protocol, and yes the :load-file command will load the file from scratch each time:

image

But the loading time on my side is relatively acceptable, do you work with an iPKG based Idris project or a standalone Idris file? Can you give me the code snippets which you found the loading time is quite long? Thanks in advance!

@zjhmale
Copy link
Owner

zjhmale commented May 7, 2017

Probably we should fire an issue for this on Idris upstream repository.

@ndmitchell
Copy link
Author

I work with idris.exe on Windows 10, downloaded from the website and unpacked (not compiled). I'm working on a single Idris file, namely:

module Hello

hello : String
hello = "test"

After hitting Ctrl S to save it takes 4 seconds for the output to return to "File loaded successfully". To :load the file in the Idris interactive environment takes < 1s (around 0.4s). To :reload the file takes perhaps 0.2s. So it may not be :load-file, but might be something else. Is there any way to get more detailed timings of how long the individual steps take?

@zjhmale
Copy link
Owner

zjhmale commented May 8, 2017

Sorry for the delay, I will do some investigation here.

@zjhmale
Copy link
Owner

zjhmale commented May 27, 2017

Hi @ndmitchell, sorry for the huge delay. I look at this issue again and find out the reason under the hood. The extension will kill the Idris process every time when the typechecking process succeeds because of this issue here #52, so basically, you have to wait for the Idris process getting up again every time when you run the typechecking command, that will cost you around 2-3 seconds.

@ndmitchell
Copy link
Author

Perhaps kill the Idris process every N evaluations, where N is ~1000 or similar?

@zjhmale
Copy link
Owner

zjhmale commented May 28, 2017

@ndmitchell Good idea, I will do that, and the N will also be configurable then.

@zjhmale
Copy link
Owner

zjhmale commented May 28, 2017

@ndmitchell 1000 times is too large for this, the memory leaking issue will happen every 50 times of continuous type checking I guess, so I set the default continues type checking times to 10 here.

@clayrat
Copy link

clayrat commented May 29, 2017

Do you still think that adding a reload command to IDE protocol is useful?

@zjhmale
Copy link
Owner

zjhmale commented May 29, 2017

@clayrat Yes, I think so. I'm not familiar the underlying implementation of IDE protocol, but a reload command is mandatory indeed, besides that the IDE protocol need to add more generalized type-of and docs-for command to get information about local identifiers and the repl-completion need some performance optimization and need to return the kind of the identifiers e.g. function, variable or type as mentioned here #31.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants