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

Missing Daemon mode #514

Closed
drasill opened this Issue Dec 15, 2016 · 7 comments

Comments

Projects
None yet
3 participants
@drasill

drasill commented Dec 15, 2016

I understand why the daemon mode was removed from rofi.

But it had a huge benefit, IMHO : rofi was almost instantaneous when pressing the trigger key.

Now, as my computer is often slow, there can be many seconds before rofi starts (on a cold start).

Is there any hope to have the daemon mode reactivated ?
Or do you known any method to have the rofi binary kept in cache ?

@DaveDavenport

This comment has been minimized.

Show comment
Hide comment
@DaveDavenport

DaveDavenport Dec 15, 2016

Owner

This has been discussed many times before and there seems to be myths going around about it.
First: In my opinion launching programs on global keybindings does not belong in rofi. This is the task of the Window Manager, DE or a separate daemon.

Secondly, rofi is very fast starting up and the difference between daemon mode and non daemon mode always been neglectable for me (milliseconds difference). ( in git the startup time and time to be interactive has been improved even further).

So the only thing is if you use rofi very infrequently on a very low memory machine its library like cairo, libxcb (That are shared with many others apps) might get discarded. But in situations like this even when running in background it is likely that its memory is swapped away in that case.

See also here for a more detailed discussion on this.

Some numbers: So on my laptop, rofi grabs the keyboard after 15ms of running, from command issue, to rofi executing main is 12 ms. So within 30ms I can start typing. I know this is a reasonably quick laptop, I will add numbers from my slow arm notebook that runs of a cheap usb stick later.

As the seconds startup, this is likely I/O? please post a timing trace (see wiki) to actually see where this time is spend.

Owner

DaveDavenport commented Dec 15, 2016

This has been discussed many times before and there seems to be myths going around about it.
First: In my opinion launching programs on global keybindings does not belong in rofi. This is the task of the Window Manager, DE or a separate daemon.

Secondly, rofi is very fast starting up and the difference between daemon mode and non daemon mode always been neglectable for me (milliseconds difference). ( in git the startup time and time to be interactive has been improved even further).

So the only thing is if you use rofi very infrequently on a very low memory machine its library like cairo, libxcb (That are shared with many others apps) might get discarded. But in situations like this even when running in background it is likely that its memory is swapped away in that case.

See also here for a more detailed discussion on this.

Some numbers: So on my laptop, rofi grabs the keyboard after 15ms of running, from command issue, to rofi executing main is 12 ms. So within 30ms I can start typing. I know this is a reasonably quick laptop, I will add numbers from my slow arm notebook that runs of a cheap usb stick later.

As the seconds startup, this is likely I/O? please post a timing trace (see wiki) to actually see where this time is spend.

@DaveDavenport

This comment has been minimized.

Show comment
Hide comment
@DaveDavenport

DaveDavenport Dec 15, 2016

Owner

For timing trace see here

As I indicated in other issue, if there really is benefit to daemon mode, I will consider re-adding it.

Owner

DaveDavenport commented Dec 15, 2016

For timing trace see here

As I indicated in other issue, if there really is benefit to daemon mode, I will consider re-adding it.

@DaveDavenport

This comment has been minimized.

Show comment
Hide comment
@DaveDavenport

DaveDavenport Dec 15, 2016

Owner

This topic might also be interesting.

If you want to debug the slowness, please provide the information as requested in the guidelines as linked on the top of the new issue page.

Owner

DaveDavenport commented Dec 15, 2016

This topic might also be interesting.

If you want to debug the slowness, please provide the information as requested in the guidelines as linked on the top of the new issue page.

@DaveDavenport

This comment has been minimized.

Show comment
Hide comment
@DaveDavenport

DaveDavenport Dec 15, 2016

Owner

this might be useful too.
Please let me know the results.

Owner

DaveDavenport commented Dec 15, 2016

this might be useful too.
Please let me know the results.

@bombela

This comment has been minimized.

Show comment
Hide comment
@bombela

bombela Jan 6, 2017

My computer is not slow, but for some reason when I start rofi via some i3 binding, it doesn't seem to run rofi until I release the shortcut keys. But this only happens with rofi, it doesn't happen when I start a terminal emulator or run some other program that I have direct shorcuts for.

bombela commented Jan 6, 2017

My computer is not slow, but for some reason when I start rofi via some i3 binding, it doesn't seem to run rofi until I release the shortcut keys. But this only happens with rofi, it doesn't happen when I start a terminal emulator or run some other program that I have direct shorcuts for.

@bombela

This comment has been minimized.

Show comment
Hide comment
@bombela

bombela Jan 6, 2017

It does run rofi, but rofi terminates itself almost instantaneously. As long as i keep pressing my i3 shorcut, it it will start rofi and rofi will abort, until i release the shortcut, then rofi will not exit and show itself.

auditctl -a exit,always -S execve
tail -f tail -f /var/log/audit/audit.log 

Example:

type=ANOM_ABEND msg=audit(1483671823.819:4389): auid=4294967295 uid=1000 gid=1000 ses=4294967295 pid=4101 comm="rofi" exe="/usr/bin/rofi" sig=6

After login the output of rofi to a file, and pressing the shortcut for a couple seconds, I get:

Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to grab keyboard, even after 500000 uS.**
ERROR:source/view.c:264:rofi_view_set_active: assertion failed: (( current_active_menu == NULL && state != NULL ) || ( current_active_menu != NULL && state == NULL ))
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Aborted (core dumped)
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to grab keyboard, even after 500000 uS.**
ERROR:source/view.c:264:rofi_view_set_active: assertion failed: (( current_active_menu == NULL && state != NULL ) || ( current_active_menu != NULL && state == NULL ))
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Aborted (core dumped)

Because everything happens so fast, I suspect the lines are not in the correct order,

bombela commented Jan 6, 2017

It does run rofi, but rofi terminates itself almost instantaneously. As long as i keep pressing my i3 shorcut, it it will start rofi and rofi will abort, until i release the shortcut, then rofi will not exit and show itself.

auditctl -a exit,always -S execve
tail -f tail -f /var/log/audit/audit.log 

Example:

type=ANOM_ABEND msg=audit(1483671823.819:4389): auid=4294967295 uid=1000 gid=1000 ses=4294967295 pid=4101 comm="rofi" exe="/usr/bin/rofi" sig=6

After login the output of rofi to a file, and pressing the shortcut for a couple seconds, I get:

Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to grab keyboard, even after 500000 uS.**
ERROR:source/view.c:264:rofi_view_set_active: assertion failed: (( current_active_menu == NULL && state != NULL ) || ( current_active_menu != NULL && state == NULL ))
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Aborted (core dumped)
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to grab keyboard, even after 500000 uS.**
ERROR:source/view.c:264:rofi_view_set_active: assertion failed: (( current_active_menu == NULL && state != NULL ) || ( current_active_menu != NULL && state == NULL ))
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Failed to set lock on pidfile: Rofi already running?
Got error: -1 Resource temporarily unavailable
Aborted (core dumped)

Because everything happens so fast, I suspect the lines are not in the correct order,

@DaveDavenport

This comment has been minimized.

Show comment
Hide comment
@DaveDavenport

DaveDavenport Jan 6, 2017

Owner

Don't!!!!!!!!! highjack issue reports and check other issues, #524 .

Owner

DaveDavenport commented Jan 6, 2017

Don't!!!!!!!!! highjack issue reports and check other issues, #524 .

Repository owner locked and limited conversation to collaborators Jan 6, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.