User Tools

Site Tools


public:stuff

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
public:stuff [2022/10/01 19:05]
canvon created: Add speed test
public:stuff [2022/10/19 00:47] (current)
canvon [Speed test] Fix breaking the following section
Line 1: Line 1:
 ====== Stuff ====== ====== Stuff ======
 +
 +Some miscellaneous stuff that doesn't fit otherwise into [[.:start|the structure]]...
 +
 +For example, [[#speed_test|speed test by ''timeout'' + ''dd'']], [[#video_file_comparison_using_mpv|video file comparison using mpv]], [[#windows_fork_problems|Windows fork problems]]...
 +
  
 ===== Speed test ===== ===== Speed test =====
Line 6: Line 11:
 root@ubuntu:~# timeout --foreground -s INT 60s dd if=/dev/sda bs=4096 of=/dev/null  # ad-hoc USB3 storage speed test... root@ubuntu:~# timeout --foreground -s INT 60s dd if=/dev/sda bs=4096 of=/dev/null  # ad-hoc USB3 storage speed test...
 </code> </code>
 +
 +The idea is to not measure transfer duration of a fixed size, but to let it run through until a fixed time has passed (and then look at the transfer speed). For this, we wrap the ''dd'' invocation into the ''timeout'' command.
 +
 +The problem, then, was that ''dd'' didn't output **anything** when run under ''timeout''.
 +
 +The solution was to use //both// of ''--foreground'' and ''-s INT'' (after the timeout expires, fire signal SIGINT at the wrapped process) //together//. This restored dd's output-at-end, which will now tell the overall transfer speed, as previously expected.
 +
 +
 +===== Video file comparison using mpv =====
 +
 +To just get the console output of ''mpv'' where it describes the file played (so we can run a wdiff over the saved outputs of similar files): (Previously, it used to be ''mplayer --identify'' or somesuch.)
 +
 +<code>
 +$ mpv --vo=null --ao=null --frames=1 ...
 +</code>
 +
 +
 +===== Windows fork problems =====
 +
 +On Windows (Win32 API), a process can well have threads, but no ''fork()''-without-''exec()'' is possible, as processes are created to be separate (spawn?)...
 +
 +The CygWin compatibility layer for Linux/UNIX-targetted programs had to work hard to get something similar going: [[https://cygwin.com/cygwin-ug-net/highlights.html#ov-hi-process|CygWin highlights: Process Creation]] (via [[http://blog.rolpdog.com/2020/03/why-no-ansible-controller-for-windows.html|ansible controller heavy user of fork() without exec()]])
  
  
public/stuff.1664643922.txt.gz ยท Last modified: 2022/10/01 19:05 by canvon