Error handling and UTF-8 validation

I looked into the Source Code of the GNU time Command:
https://www.gnu.org/software/time/
https://ftp.gnu.org/gnu/time/
It also doesn't do anything different than

date ; $command ; date

and also uses the struct rusage *usage to find the Process Consumptions.
but in differences it only launches 1 Child Process

So I made a little Application that would measure the complete Execution time from the Spawn to the Reap of the Child Process and measure the Process Consumptions with getrusage() continuesly.

Very surprisingly after 1000 Executions the Values of the struct rusage *usage have grown significantly:

prfg no. '1000' (code: '0'): rpt: ''
prfg stt: ''
prfg mem: ''
prfg fll stt: ''
prfg user '21.848453'
prfg system '4.904511'
prfg res mem '8236'
prfg usg dmp:
{
  ru_idrss    => 0,
  ru_inblock  => 0,
  ru_isrss    => 0,
  ru_ixrss    => 0,
  ru_majflt   => 0,
  ru_maxrss   => 8236,
  ru_minflt   => 2219321,
  ru_msgrcv   => 0,
  ru_msgsnd   => 0,
  ru_nivcsw   => 3296,
  ru_nsignals => 0,
  ru_nswap    => 0,
  ru_nvcsw    => 3003,
  ru_oublock  => 0,
  ru_stime    => 4.904511,
  ru_utime    => 21.848453,
}

Which gives insight that the Dokumentation on the Statement
https://man7.org/linux/man-pages/man2/getrusage.2.html

RUSAGE_CHILDREN
Return resource usage statistics for all children of the
calling process that have terminated and been waited for.

is for real

So the correct interpretation of this value could only be on a one on one call. Just as it does the GNU time command.
A small minimalist application would run the Command to profile and the Manager Application would evaluate the statistics.

So for now my Profiling Tool measures only the time from Spawn to Reap and calculates the 95% Line and Average Time.
But even more it processes the SIGCHLD Signal to reap the Child Process at the most earliest moment.

As a result it reported for the Rust Application:

$ ./command_profiler.pl -r 1000 -d --dir=../../rust/text-sanitizer 'target/release/text-sanitizer -i es de < ../../lanzarote-com_de-ausfluge.html.x100 >/dev/null' 
Execution Time 95%: '0.039576' s
Execution Time AVG: '0.028952' s
Execution Time MIN: '0.025503 s
Execution Time MAX: '0.044042' s

And the other Implementation:

$ ./command_profiler.pl -r 1000 -d --dir=../../pas*/text* './text-sanitizer.run -i es de < lanzarote-com_de-ausfluge.html.x100 >/dev/null'
Execution Time 95%: '0.052116' s
Execution Time AVG: '0.038323' s
Execution Time MIN: '0.033591' s
Execution Time MAX: '0.056527' s

Rust holds it's Advantage on Big Data Volume.

But on normal Data Volume it performs just the same or even a bit slower:

$ ./command_profiler.pl -r 1000 -d --dir=../../rust/text-sanitizer 'target/release/text-sanitizer -i es de < ../../lanzarote-com_de-ausfluge.html >/dev/null'
Execution Time 95%: '0.003929' s
Execution Time AVG: '0.003573' s
Execution Time MIN: '0.003308' s
Execution Time MAX: '0.007229' s

And the other Implementation:

$ ./command_profiler.pl -r 1000 -d --dir=../../pas*/text* './text-sanitizer.run -i es de < lanzarote-com_de-ausfluge.html >/dev/null'
Execution Time 95%: '0.003617' s
Execution Time AVG: '0.003208' s
Execution Time MIN: '0.002963' s
Execution Time MAX: '0.005126' s