anki-code / xunter

Tracing and profiling for the xonsh shell based on python-hunter.
MIT License
9 stars 1 forks source link

profiling .xonshrc #1

Open RitikShah opened 2 years ago

RitikShah commented 2 years ago

How exactly can I use this to profile my rc file, I want to know how I can speed up my boot time now that I've bogged everything down, but I don't exactly understand how to boot this before my xonshrc goes thru (esp understanding how long it takes to load each module!

anki-code commented 2 years ago

I think you can use old style for this:

t = time.time()
# my command
print(f"{time.time() - t} sec")
RitikShah commented 2 years ago

I suppose I can do that for specific commands and maybe automate some profiling for my xontribs but I was hoping to see if xunter could help with giving me detailed timings for each part of my rc file.

anki-code commented 2 years ago

I believe that there is the way for this but I have no recipe now.

Feel free to add the instructions to README after research.