Closed certik closed 6 years ago
Thanks for reporting! I get start up times on the order of 0.5 sec. Still I think one thing that I'll probably do is add an alias / xontrib so that starting up from xonsh is much faster.
Ok, I have added a xontrib which more or less takes care of this for me, since xo xo.py
will now execute in about 0.27 - 0.36 seconds for me.
I just use bash for my shell...can we do something else to speed up startup? I was reading about python and startup issues https://files.bemusement.org/talks/OSDC2008-FastPython/ which makes several recommendations. I was able to speed up xo startup with lazy regular expressions. I was thinking about playing with lazy imports. Would you be interested in a PR for lazy imports and lazy re?
Hi @rovitotv - always happy to have PRs! However, note that the fundamental problem with the slow startup times is pygments, which relies on pkg_resources
to find Lexers for the files we are reading in. I have an idea about how to cache these in such a way that would speed up load times dramatically. (I also need this for xonsh), but I haven't gotten around to writing it yet.
With the latest release exofrills 0.3.0 xo is a lot faster on startup, thank you! pygments-cache seems to have done the trick.
Woohoo! That is great to hear! I am going to go ahead and close this issue, but please feel free to reopen if needed!
👍
I did a test, when I open a file, and then close it as quickly as I can using
CTRL-X
, and measure how long it takes (closing is immediate, the startup time is long):The best time is 1.281s. Compare to Vim:
Best time 0.282s, and I have to press
ZZ
, which is slower thanCTRL+X
.Conclusion:
xo
takes 1s more to start thanvim
on my machine. Vim is immediate (the 0.2s is the time it takes me to presZZ
), whilexo
literally takes a second to start.