bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Revisiting Error handling (errexit)


From: Alex fxmbsw7 Ratchev
Subject: Re: Revisiting Error handling (errexit)
Date: Fri, 8 Jul 2022 13:28:55 +0200

On Fri, Jul 8, 2022, 12:44 Koichi Murase <myoga.murase@gmail.com> wrote:

> 2022年7月8日(金) 19:29 Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com>:
> > > >      ls -l /production/path | mail -s "all-good" notify@company.com
> ||
> > > > true    # Not critical
> > >
> >
> > small side note there, a || true is big slow imho
>
> What does it mean? If you are talking about the execution time, "||
> true" is much faster than spawning external processes like "ls" and
> "mail". I've measured it in my system, but the overhead by "|| true"
> is about 270ns (assuming the error basically does not happen if the
> environment is properly set up) while the overhead by a pipe "ls -l |
> cat -v" (where I replaced "mail ..." with "cat -v") is about
> 6630200ns. The main command is 2.5x10^6 times slower. In real cases, I
> would expect that "mail" would take much more time than "mail". Even
> if the main command does not "fork" or "exec" new processes, I believe
> 270ns is always negligible.
>
> --
> Koichi
>

hi mate
i always mean high speed serial as mass as possible
aka, i would never use this code ever, excepts its not my rules

also not meaning the 'never hit' at all case

dont mind me mate, im outdated i dont computer atm since long

greets

>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]