-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gum log
performance prohibitively slow in some (all?) envs
#848
Comments
gum log
performance prohibitively slowgum log
performance prohibitively slow (10+ seconds for 100 invocations)
gum log
performance prohibitively slow (10+ seconds for 100 invocations)gum log
performance prohibitively slow (WSL2 only...?)
gum log
performance prohibitively slow (WSL2 only...?)gum log
performance prohibitively slow in some envs
gum log
performance prohibitively slow in some envsgum log
performance prohibitively slow in some (all?) envs
On native windows Windows, outside of WSL (using
Gives This is much better, but that will be because it's outside the WSL VM probably. Either because of the perf gains of that or that part of the problem is also linked to UNIX flows, or both. Even this is still quite high I feel. There has to be some compute going on that makes the problem aggravated and especially visible on "weaker" envs. Back to UNIX, There is an extremely high amount of voluntary context switches:
Consistently 150ms per invocation with console print. 100ms without. |
gum log
performance prohibitively slow in some (all?) envsgum log
performance a bit slow in some (all?) envs
gum log
performance a bit slow in some (all?) envsgum log
performance prohibitively slow in some (all?) envs
Describe the bug
I am using
gum log
throughout my shell script and I notice that it is really quite slow to invoke. Here is a comparison of 100 invocations of it against/bin/echo
(not echo built into shell so both still have extra process cost) just printingtest
.As such, logging in any shell script using
gum log
makes everything feel tangibly slower and is essentially the bottleneck in my script.I would of course, expect it to be slower than
/bin/echo
, so the comparison isn't entirely equal. But this much slower feels like a surprise and because of the use case of logging, its particularly a problem. Here it is with all output put into/dev/null
:And here it is without suppressing the output:
To Reproduce
Put this shell script somewhere:
Then execute it. This uses bash in the shebang but the shell used to execute it appears not to matter.
You can remove the
> /dev/null 2>&1
if wanting to try with it printing visibly to console.Expected behaviour
I would expect the
gum log
invocation time to be much cheaper.Desktop (please complete the following information):
OS: Ubuntu 24.04.1 LTS on WSL2
Machine pretty cutting edge (9800X3D CPU).
Result of
wsl --version
:Result of
gum --version
:The text was updated successfully, but these errors were encountered: