Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[WIP] Daemon Mode to decrease startup time #2473
Hi folks! I'm not submitting this as a PR as it's currently in a bit of an unfriendly state test-wise, and I don't want to lock up a bunch of test runners for no good reason.
My branch introduces a way of running a partially initialised xonsh instance as a daemon that clients can connect to and fork off of to complete initialisation - see the commit messages for a description of what's going on. It reduces up start up time quite a bit in my testing, bringing the startup from an average of ~360ms to approximately ~140ms. Measured by putting this in my xonshrc:
Starting xonsh regularly:
Versus starting it with the daemon:
And surely there are more as well. I'm opening up discussion on this as I think reducing startup time by 200ms, even if a little hacky, is worth talking about :) Aside from the above issues, I've been using this code for a few weeks now with great success.
There's a bunch of print statements left in the code to aid in measuring how long some things take, which are what's messing with the tests - once the branch becomes more stable, I'll rebase the print statements away, of course.
It didn't! Most flags don't work, I'm afraid - quite a lot of them need to be reimplemented. I've pushed another commit that "fixes" --timings though, so now when the client is started with --timings, they'll be displayed: