-
Notifications
You must be signed in to change notification settings - Fork 14
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
Slow startup #52
Comments
Hello @diggit Thank you for reporting. I think this is because tym uses Lua for configuration. When starting up, tym needs to initialize Lua context, parse config Lua script, run it and apply aggregated values to the app. Some of the procedures might be slow. Or tym depends on GTK and GTK might be potentially slower than bare X11. In any case, I'm not sure which makes tym slow. I need some time to investigate the reason. Feel free to let me know if you have anything other. |
I don't know how to analyze it. For start, I tried to remove config and theme files. I found another problem this way...
and tym keeps running with my default shell which is fish, entirely ignoring |
I'm sorry. It is a kind of bug that option is not applied when config is not loaded. I have fixed at 42b243c and released 2.3.0. You can get the new version from AUR now. |
i'd really like for this to be investigated since my only complaint about tym is 1st time startup being slow, ranging in multiple seconds, but after is similar speeds to whats shown below and for reference (hyperfine is a better benchmarking tool)
|
How about a server - client mode.. can be useful in this context. During starting the server, tym have to parse the lua configs only once and then spawning the clients will be much faster. |
tym is supporting server-client mode now. When you start tym at first, the instance becomes a primary instance. Then, if you start another an instance, the process will stop immediately instead of spwaning a new window on the primary process. First time:
Second time:
The log of the second spawn will be printed on the primary instance. |
From my experience it would be best to have a daemon mode similar to the one urxvt has, that way you don't need to rely on a client already being open for fast startup. Not sure if that's viable but it would be a great addition. |
this sounds really great if I haven't misunderstood something this would be something like runing a tui app in tmux/screen or like using emacs-daemon/emacs-client I've had some issues with startup-times on one of my machines, but only on first run and would LOVE to have them fixed as I really enjoy the program |
@Stardust-kyun @erikLundstedt |
No rush! Glad to hear it's planned, I'm really loving tym so far :) |
Thank you greatly I currently use tym as a secondary terminal emulator as I am usually a heavy tab-user (I use wezterm as my main one, and am loving it aswell). Take the time you need to implement it without getting burnout. I really appreciate the work you have done and I always love to see more stuff be configurable in Lua (or in my case, fennel lisp ) as it's one of my favourite programming languages |
I have pushed #90 and started implementation. This feature was fortunately easy to be realized. I'm planning to add user-level systemd unit. Requests will be accepted on the PR thread. This feature will be contained in the next release. |
🔥🔥 hell yea I'll try this out when I get home |
|
Currently using it, appears to be working smoothly so far! |
@endaaman on my system: tym (tym-git from the aur) $ systemctl start --user tym-daemon.service
$ hyperfine --warmup 3 'tym -e "sh -c exit"'
Benchmark 1: tym -e "sh -c exit"
Time (mean ± σ): 134.0 ms ± 10.1 ms [User: 13.8 ms, System: 5.2 ms]
Range (min … max): 125.4 ms … 163.4 ms 19 runs
$ systemctl stop --user tym-daemon.service
$ hyperfine --warmup 3 'tym -e "sh -c exit"'
Benchmark 1: tym -e "sh -c exit"
Time (mean ± σ): 282.8 ms ± 10.7 ms [User: 200.1 ms, System: 28.8 ms]
Range (min … max): 265.2 ms … 299.5 ms 10 runs compared to my "main" terminal, which is known to be fast, is written in rust,configured in lua, and is "GPU assisted"... Benchmark 1: wezterm start --always-new-process sh -c exit
Time (mean ± σ): 253.6 ms ± 16.7 ms [User: 47.0 ms, System: 35.5 ms]
Range (min … max): 228.7 ms … 284.2 ms 11 runs compared to miniterm hyperfine --warmup 3 'miniterm -e "sh -c exit"'
Benchmark 1: miniterm -e "sh -c exit"
Time (mean ± σ): 194.4 ms ± 9.3 ms [User: 125.6 ms, System: 24.2 ms]
Range (min … max): 181.9 ms … 211.3 ms 14 runs and lastly, compared to alacritty
|
Hi,
I noticed, that tym startups are slow (and maybe getting gradually slower?)
Here is comparison with urxvt:
200 ms might be ok for some users, but I spawn terminals in tiling wm (i3) pretty often. Slow startup causes, that tym misses several keystrokes when start typing immediately after launching tym (with kb shortcut).
Using Arch Linux, tym version 2.2.1.
EDIT:
under heavy CPU load:
The text was updated successfully, but these errors were encountered: