[HN Gopher] Ask HN: Is there any tool for benchmarking responsiv...
___________________________________________________________________
Ask HN: Is there any tool for benchmarking responsiveness for
Linux?
System76 recently announced their responsiveness optimizer,
System76 Scheduler [0], which basically works as a daemon,
adjusting the nice value and the CFS knobs for processes in the box
for increased responsiveness. They've claimed that the
responsiveness is therefore increased, which I'm also believed so.
However, this got me wondering, is there exists any tool that can
report the "numbers" (e.g., scheduling latency) regarding to the
responsivenss? Maybe Google has such tool for testing regression
for Android or Chrome OS, sadly, I didn't managed to find one.
Thanks! [0] https://github.com/pop-os/system76-scheduler
Author : c0deR3D
Score : 64 points
Date : 2022-02-04 16:59 UTC (6 hours ago)
| smoldesu wrote:
| You're probably looking for sysprof: http://www.sysprof.com/
| eloh wrote:
| I can recommend this one: https://apps.apple.com/de/app/is-it-
| snappy/id1219667593
|
| Was mentioned on HN some time ago.
| rob_c wrote:
| on L I N U X...
| stefan_ wrote:
| The linux-rt project has a variety of test programs for this:
|
| https://wiki.linuxfoundation.org/realtime/documentation/howt...
|
| But beware, "scheduling latency" has very little to do with
| responsiveness as it would appear to a user of some desktop
| environment.
| unwind wrote:
| I wonder if Ben Heck's "Controller Monitor" [1] would help. It's
| a dedicated low-level (microcontroller-driven) high-speed input
| sampling/logging platform, with support for reading a light
| sensor which I believe is used to sense on-screen changes.
|
| It has the advantage of using game console joypads as inputs, and
| hacking them to read the buttons etc directly, i.e. without
| relying on USB. I imagine a specialized version that just sampled
| a mouse button would be more useful in the context of a computer
| running desktop apps.
|
| Apologies if I completely misunderstood the intent of this post.
|
| [1] https://www.benheck.com/xbox1monitor/
| halz wrote:
| Weird, the measurement scale they use does not jive with the
| scale of the knobs being tweaked. For example,
| `sched_cfs_bandwidth_slice_us` is adjusted by the project's
| `bandwidth_size` knob. The default is 5000 us, or 5 ms. But the
| knob they mention it being '5 us'. Same goes for scheduling
| latency-- its not `us`, its `ms`.
|
| And afaik, the 'sauce' used in Liquorix is MuQSS, by Con Kolivas.
| But the project has been put on ice somewhat recently[0].
|
| [0]https://ck-hack.blogspot.com/2021/08/514-and-future-of-
| muqss...
| Animats wrote:
| Tracy? It's mostly used by game devs.
| ahub wrote:
| Not sure if it's relevant but I liked the approach of Pavel Fatin
| in measuring editor latency [0]. It uses OS level input events
| and actual rendering on screen. So testing the same editor/file
| with different settings might yield results that are different
| depending on your scheduling config, while staying close to a
| "real world" example. He shared [1] the tool he made for the
| tests.
|
| I'd be curious to know your results regardless of the technique
| used.
|
| [0] https://pavelfatin.com/typing-with-pleasure/ [1]
| https://github.com/pavelfatin/typometer
| tanelpoder wrote:
| In addition to what others have said:
|
| - eBPF script:
| https://www.brendangregg.com/blog/2016-10-08/linux-bcc-runql...
|
| - perf sched: https://www.brendangregg.com/blog/2017-03-16/perf-
| sched.html
|
| - schedlat: https://tanelpoder.com/posts/schedlat-low-tech-
| script-for-me...
|
| The last one (written by me) is using /proc/PID/schedstat
| pseudofile for monitoring % time spent in the CPU runqueue of a
| single process (not systemwide). I don't always have (root)
| access for running perf or eBPF scripts (or the old Linux/kernel
| version don't allow that). But I can still measure how much time
| a process on a request's critical path (like a RDBMS transaction
| log writer on commit) spent waiting to get back onto CPU before
| doing any work.
|
| Like others have already said, the OS CPU queuing/scheduling
| latency is just one component contributing to the total
| responsiveness/reaction latency of your app.
| hulitu wrote:
| Con Kolivas (maintainer of BFS) had at one time some tools.
| hulitu wrote:
| https://github.com/ckolivas/interbench
| throwaway8582 wrote:
| I've used `cyclictest` for this before, it's a simple command
| line application that measures how long it takes to wake up and
| run a user space process in response to an interrupt. I've used
| it in the context of minimizing latency for network and audio
| applications. I'm not sure how much this relates to desktop
| application responsiveness as there are additional layers
| involved.
| assemblylang wrote:
| IIRC the Zen Linux kernel[0] is designed to be more responsive
| for desktop usage than the mainline Linux kernel. I wonder what
| metrics these tools would provide on the same exact system except
| with the 2 different kernels. (also see Liquorix patch set for
| additional patches on top of Zen[1])
|
| [0] https://github.com/zen-kernel/zen-kernel
|
| [1] https://liquorix.net/
| 1_player wrote:
| Liquorix isn't the Zen kernel, but it's a set of patches on top
| of Linux, including Zen among others.
|
| https://github.com/zen-kernel/zen-kernel
| assemblylang wrote:
| Thanks for the correction, updated the post
| sgc wrote:
| Anybody out there using this? Thinking of trying it on my older
| thinkpad.
| seanw444 wrote:
| I hear it doesn't yield considerable differences on beefier
| hardware, but you can tell the difference on older stuff.
| Thinkpad may benefit.
|
| Note that Liqourix is not _the_ Zen kernel though.
| timetraveller26 wrote:
| I use it on my w530. It feels fast and responsive, but I
| haven't done a proper test or anything.
|
| One of the good things it's that includes patches that allow
| Anbox to run so I can use Android apps.
| [deleted]
| [deleted]
| PaulDavisThe1st wrote:
| https://wiki.linuxfoundation.org/realtime/documentation/howt...
|
| This is the goto tool for measuring SCHED_FIFO (realtime)
| scheduling performance. If you really care about responsiveness
| in a broad sense (not just user/GUI), this is likely to play some
| role your testing process.
| marcodiego wrote:
| If the computer is slow enough under load, you can use wall clock
| to count many seconds it takes to start a program that needs to
| load many libs and data (LibreOffice, Firefox, Blender, GIMP).
|
| You can also watch FPS of supertuxkart when the system is under
| load: https://www.youtube.com/watch?v=c5bAOJkX_uc
| https://github.com/hakavlad/le9-patch
|
| But yes, we need a popular well behaved benchmark to measure
| desktop responsiveness.
| AtlasBarfed wrote:
| That would be some tough things to measure.
|
| How much can you slow down a cpu anyway? Can you slow it to
| 1/10th its clock speed? I would think the best way to measure
| things like this is to slow down the overall system speed as much
| as possible.
| ahartmetz wrote:
| For input device to screen measurement, high frame rate camera on
| your phone. Accuracy isn't the best, but what you measure is as
| real as it gets.
| jrockway wrote:
| To me the question is how do you use that method to measure
| keyboard responsiveness? On the camera, you can't quite tell
| when the key was "supposed" to trigger. I've done these
| measurements by having a keypress toggle an LED on the keyboard
| (in firmware), but that glosses over the matrix scan (and
| potentially debouncing if you implement that wrong). All in
| all, I've never been fully satisfied there. Maybe you need a
| one-key keyboard that triggers the LED from an interrupt, and
| then handles the keypress normally. (Only one key, so no
| matrix. Triggers on the first edge, so no debounce latency.)
| ahartmetz wrote:
| AFAIK you'd have to have a pretty bad keyboard for it to have
| a significant role in latency. I guess specialized hardware
| (based on a microcontroller with built-in USB host support)
| wouldn't be too hard to construct if you really needed to
| know.
|
| For the camera measurement, I would just press the key as
| fast as possible and pick about 3/4 of the way down as the
| trigger point.
| jcelerier wrote:
| > AFAIK you'd have to have a pretty bad keyboard for it to
| have a significant role in latency
|
| https://danluu.com/keyboard-latency/ puts a lot of
| keyboards >= 30 ms which is an insane amount of latency
| squeaky-clean wrote:
| So if you check the appendix section, they say they're
| measuring latency not when the keyswitch makes contact,
| but when the finger first begins pressing on the key. So
| they're taking key travel time into account, and that
| ends up being the majority of the "latency".
|
| It's a fair point for the gaming argument they make, if
| you want to jump 30ms quicker you'll need shorter keys.
| But it's not really correct to say the keyboard is adding
| so much latency when it's actually the user.
| wmwmwm wrote:
| I built one! Arduino Leonardo and a light dependent
| transistor:
|
| https://github.com/willmuldrew/lagmeter
|
| (It attempts to do a few other things but it's best for
| measuring keyboard event to screen update latency)
| Underphil wrote:
| Or use the caps lock key and have that reflected on screen.
| gfd wrote:
| Is the caps lock LED even implemented in hardware? I feel
| like I remember them not responding if my computer freezes
| but I could be wrong.
| eulers_secret wrote:
| I can confirm the LED is not controlled by only keyboard
| firmware.
|
| I very often use num lock and caps lock responsiveness to
| check if my PC has hard-locked, and I just recently
| suffered hard locks while testing S3 on Linux on a new
| PC. So I am very sure at this point :)
| jrockway wrote:
| Caps lock doesn't magically skip the matrix scan.
| andi999 wrote:
| What about fpga which issues a (fake) ps2 keypressed signal
| and synchronous trigger (led in this case) for the camera?
| ziggus wrote:
| I believe the question is less about input latency than (as
| mentioned,) scheduling latency or the amount of time from when
| the scheduler marks a process as 'ready to execute' to the time
| it actually starts executing.
|
| SchedLat (https://tanelpoder.com/posts/schedlat-low-tech-
| script-for-me...) is one tool/approach to doing this, but it's
| a bit out of date.
___________________________________________________________________
(page generated 2022-02-04 23:00 UTC)