Giter VIP home page Giter VIP logo

Comments (6)

xdbob avatar xdbob commented on July 20, 2024

What do you mean by "slow", how do you use brightnessctl ?

Since changing the brightness is inherently a privileged operation, we need an escalation mechanism and most distributions should be using the logind's DBus interface witch is slow-ish.

You can try to run brightnessctl as root to see if its "fast"

from brightnessctl.

albinahlback avatar albinahlback commented on July 20, 2024

I am not implying that it takes seconds to run, just that it takes more time compared to other solutions I have experienced.

Simple timings via time took around 10-20ms (poor benchmark, yes) on my system on Arch Linux with Skylake. In comparison to the very simple light, it does feel a lot slower. I haven't benchmarked the latter.

It is understandable that it relies on other stuff that may be bottlenecks, but my question is more if anything actually can be sped up, or that if the current solution does not allow for significant speedups.

from brightnessctl.

Hummer12007 avatar Hummer12007 commented on July 20, 2024

@albinahlback when not specifying a device, brightnessctl still reads all devices even though it then takes only one.
We also have a uname call to make sure we're on linux which probably doesn't make sense in runtime.
Additionally, you should install udev rules for better performance (and not go through the dbus stuff).
When reading the device, iterating readdir output instead of directly trying to access necessary dirs may be inefficient too.

from brightnessctl.

Hummer12007 avatar Hummer12007 commented on July 20, 2024

@albinahlback
Check out #103
How does it feel?
From a cursory glance with hyperfine, it should be a little faster than light (haha) now.

from brightnessctl.

albinahlback avatar albinahlback commented on July 20, 2024

Yes, that does feel a lot faster! Thanks!

from brightnessctl.

Hummer12007 avatar Hummer12007 commented on July 20, 2024

Fixed

from brightnessctl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.