Repository navigation
How do I trace performance of Lua scripts? #905
|
I've been seeing massive performance problems in some directories where there's a very noticeable delay (roughly half a second) between typing a character and seeing it update in the terminal. After trying a bunch of different things I was eventually able to determine that the problem is somewhere in clink-gizmos; removing that from my list of scripts folders restored performance. I'd rather not disable them, though — at least not entirely. Is there a way to trace which scripts are being run on keypress and how long they take to execute? |
Replies: 3 comments 6 replies
Have you updated the gizmos repo since 9/14?I suspect that you're being affected by a recent regression of an uninitialized variable in killringbar.lua which accidentally made every key press refilter the prompt, but only if the script's "enable" setting is false. I tracked it down and fixed it on 9/14 in commit chrisant996/clink-gizmos@da9d203. What prompt are you using?I suspect you might be using a custom prompt that doesn't use asynchronous prompt filtering. If you're using a custom prompt that does use async prompt filtering, then I'm especially interested to know which prompt and to track down specifically what is the direct cause of the delay, as it means the prompt can likely be made more efficient in the first place (i.e. the prompt script is probably taking half a second every time a shell prompt is shown, and that delay can likely be reduced to essentially zero). Regarding tracing script performanceThere are a couple of ways that I trace script performance:
|
|
@mjcarman @CedricConday if you're interested in the script to integrate a Lua profiler into Clink, let me know. It's a small script to add some key bindings for starting/stopping/toggling profiling, plus a module script that is Charles Mallah's lua-profiler implementation. |
@mjcarman
Have you updated the gizmos repo since 9/14?
I suspect that you're being affected by a recent regression of an uninitialized variable in killringbar.lua which accidentally made every key press refilter the prompt, but only if the script's "enable" setting is false. I tracked it down and fixed it on 9/14 in commit chrisant996/clink-gizmos@da9d203.
What prompt are you using?
I suspect you might be using a custom prompt that doesn't use asynchronous prompt filtering.
If you're using a custom prompt that does use async prompt filtering, then I'm especially interested to know which prompt and to track down specifically what is the direct cause of the delay, as it means the prompt ca…