Skip to content
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

Significant power usage in applications using this crate #34

Closed
nagisa opened this issue Jan 30, 2021 · 3 comments · Fixed by #47
Closed

Significant power usage in applications using this crate #34

nagisa opened this issue Jan 30, 2021 · 3 comments · Fixed by #47
Labels
enhancement New feature or request

Comments

@nagisa
Copy link

nagisa commented Jan 30, 2021

The implementation of this crate relies on a sleep loop to operate. However, that means it will also cause the CPU to wake up frequently even if there are no clipboard traffic of any kind in the system.

@nagisa nagisa changed the title This crate causes significant power usage in applications using it Significant power usage in applications using it Jan 30, 2021
@nagisa nagisa changed the title Significant power usage in applications using it Significant power usage in applications using this crate Jan 30, 2021
@elinorbgr
Copy link
Member

Indeed.

This crate is, at its core, a workaround for the fact that winit has decided to not handle clipboard manipulations itself. If it had, a much more efficient implementation would have been possible.

The state of the crate can probably be improved, but it'll remain suboptimal unless winit changes its position (at which point this crate would no longer have any reason of existing).

@elinorbgr elinorbgr added the enhancement New feature or request label Jan 30, 2021
@elinorbgr
Copy link
Member

To provide more context, the correct thing to de in smithay-clipboard would be to monitor the Wayland socket using epoll to only be woken up when necessary, however as winit already does that itself, this has proven to be unreliable (only one of the sleeping threads is woken up when new data arrives, we need both).

If someone knows of a way to improve things,that would be welcome.

@zsugabubus
Copy link

zsugabubus commented Sep 17, 2021

If really there is no other way, could sleep duration be longer maybe?

kchibisov added a commit to kchibisov/smithay-clipboard that referenced this issue Oct 8, 2023
The main highlight is the move to calloop to handle all the requests
which makes it possible to remove all the active polling and clean the
data reading/writing, as well as accepting arbitrary long payloads.

This update also fixes the CI for the repository by moving it to github
actions, sets the minimum rust version, and edition to 2021.

Fixes Smithay#46.
Fixes Smithay#44.
Fixes Smithay#34.
kchibisov added a commit to kchibisov/smithay-clipboard that referenced this issue Oct 8, 2023
The main highlight is the move to calloop to handle all the requests
which makes it possible to remove all the active polling and clean the
data reading/writing, as well as accepting arbitrary long payloads.

This update also fixes the CI for the repository by moving it to github
actions, sets the minimum rust version, and edition to 2021.

Fixes Smithay#46.
Fixes Smithay#44.
Fixes Smithay#34.
kchibisov added a commit to kchibisov/smithay-clipboard that referenced this issue Oct 8, 2023
The main highlight is the move to calloop to handle all the requests
which makes it possible to remove all the active polling and clean the
data reading/writing, as well as accepting arbitrary long payloads.

This update also fixes the CI for the repository by moving it to github
actions, sets the minimum rust version, and edition to 2021.

Fixes Smithay#46.
Fixes Smithay#44.
Fixes Smithay#34.
kchibisov added a commit to kchibisov/smithay-clipboard that referenced this issue Oct 8, 2023
The main highlight is the move to calloop to handle all the requests
which makes it possible to remove all the active polling and clean the
data reading/writing, as well as accepting arbitrary long payloads.

This update also fixes the CI for the repository by moving it to github
actions, sets the minimum rust version, and edition to 2021.

Fixes Smithay#46.
Fixes Smithay#44.
Fixes Smithay#34.
kchibisov added a commit to kchibisov/smithay-clipboard that referenced this issue Oct 10, 2023
The main highlight is the move to calloop to handle all the requests
which makes it possible to remove all the active polling and clean the
data reading/writing, as well as accepting arbitrary long payloads.

This update also fixes the CI for the repository by moving it to github
actions, sets the minimum rust version, and edition to 2021.

Fixes Smithay#46.
Fixes Smithay#44.
Fixes Smithay#34.
kchibisov added a commit to kchibisov/smithay-clipboard that referenced this issue Oct 10, 2023
The main highlight is the move to calloop to handle all the requests
which makes it possible to remove all the active polling and clean the
data reading/writing, as well as accepting arbitrary long payloads.

This update also fixes the CI for the repository by moving it to github
actions, sets the minimum rust version, and edition to 2021.

Fixes Smithay#46.
Fixes Smithay#44.
Fixes Smithay#34.
kchibisov added a commit to kchibisov/smithay-clipboard that referenced this issue Oct 10, 2023
The main highlight is the move to calloop to handle all the requests
which makes it possible to remove all the active polling and clean the
data reading/writing, as well as accepting arbitrary long payloads.

This update also fixes the CI for the repository by moving it to github
actions, sets the minimum rust version, and edition to 2021.

Fixes Smithay#46.
Fixes Smithay#44.
Fixes Smithay#34.
kchibisov added a commit to kchibisov/smithay-clipboard that referenced this issue Oct 10, 2023
The main highlight is the move to calloop to handle all the requests
which makes it possible to remove all the active polling and clean the
data reading/writing, as well as accepting arbitrary long payloads.

This update also fixes the CI for the repository by moving it to github
actions, sets the minimum rust version, and edition to 2021.

Fixes Smithay#46.
Fixes Smithay#44.
Fixes Smithay#34.
kchibisov added a commit to kchibisov/smithay-clipboard that referenced this issue Oct 10, 2023
The main highlight is the move to calloop to handle all the requests
which makes it possible to remove all the active polling and clean the
data reading/writing, as well as accepting arbitrary long payloads.

This update also fixes the CI for the repository by moving it to github
actions, sets the minimum rust version, and edition to 2021.

Fixes Smithay#46.
Fixes Smithay#44.
Fixes Smithay#34.
kchibisov added a commit to kchibisov/smithay-clipboard that referenced this issue Oct 10, 2023
The main highlight is the move to calloop to handle all the requests
which makes it possible to remove all the active polling and clean the
data reading/writing, as well as accepting arbitrary long payloads.

This update also fixes the CI for the repository by moving it to github
actions, sets the minimum rust version, and edition to 2021.

Fixes Smithay#46.
Fixes Smithay#44.
Fixes Smithay#34.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants