elm-lang / elm-repl

A REPL for Elm
BSD 3-Clause "New" or "Revised" License
170 stars 34 forks source link

Is elm-rpl slow for you too? #128

Closed albacoretuna closed 8 years ago

albacoretuna commented 8 years ago

Hi, newbie here! Today I started using elm-repl and to me it feels very slow. For example:

"hello" ++ "world" Takes about 7 seconds to return the result

Version numbers: Ubuntu 16.04 node v6.2.2 elm-repl 0.17.1

process-bot commented 8 years ago

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

evancz commented 8 years ago

This is true for the very first expression. That's because it is downloading packages and building everything. After that, it has all that information, so it's faster.

zaa commented 8 years ago

@evancz I guess it would be really great to have a note in README.md that after installation the first usage might be slow because of that.

ben-wall commented 7 years ago

Mine still takes like a second to do anything even just run my simple isNegative function (every time)

sriram-srinivasan commented 6 years ago

For me too. "1+2" takes about a second on the repl. Constantly.

This is on Mac OS X Sierra.

beenotung commented 6 years ago

In my case, it takes over 20 seconds for the result of 1 (1 : number) everytime. I installed elm globally using yarn on archlinux (64bit). The command used: elm-repl --compiler $(type -p elm-make)

Then I stop the repl, launch it again, it becomes faster :/

zwilias commented 6 years ago

When you first launch the repl in a fresh directory, it needs to download and install the core libraries. Using the repl in a project or in the same directory you used it before should be a bunch faster. Basically what is mentioned as the first answer in this issue.

sriram-srinivasan commented 6 years ago

beenotung said "everytime". I'd said "constantly". We are not talking about the first time.

Edit: Sorry, that came off as terribly rude. Didn't intend to sound that way.

zwilias commented 6 years ago

Sorry for the mixup, I was responding specifically to @beenotung who mentioned "20 seconds" and "faster when launched again". Both are indicative of the problem diagnosed in the original answer.

I'm not sure what is going on in your case. It seems like a separate issue from the one this issue is about. Could you open a separate issue? It would be helpful if you could describe in some more detail what is going on - is this in an existing Elm project? Is this with things importer in the repl? Is this on the first evaluation of that expression in a session, or does it consistently happen for subsequent expressions in that same session as well? etc etc.

Thanks!

sriram-srinivasan commented 6 years ago

This is strange, but the problem is fixed. I'd deleted an older version of elm and replaced it with elm-0.18, and it is as evancz said, the very first expression takes time (but every time the real is started). The rest of the time, each expression eval take a noticeable fraction of a second, but not 7-8 seconds.

It'd be nice if the packages were cached so that the first time is not slow either, but I can live with the that for some time.

beenotung commented 6 years ago

@zwilias I cannot reproduce the problem so not going to open an issue for now. Maybe it's fixed now (0.18.0).

I was running it in non-elm project folder. And 'everytime' meant running the same statement (1) in the session continuously.