[Top][All Lists]

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

Re: Likely Bash bug

From: Robert Elz
Subject: Re: Likely Bash bug
Date: Wed, 17 Mar 2021 11:12:43 +0700

    Date:        Tue, 16 Mar 2021 22:08:17 -0500
    From:        Dennis Williamson <dennistwilliamson@gmail.com>

  | In any case this points to larger chunks being more efficient.

This is not news, doing reads (or writes) using bigger buffers (more
bytes at a time) means less system calls, and compared to almost anything
else that happens, system calls are expensive - doing less will make things
run faster.

Unfortunately, it can also alter the semantics of what is happening - whether
it does or not entirely depends upon the application.

Lastly, if you really care about any of this - that is, if it really matters
to something more than your ego - then you shouldn't be writing in shell at
all, but using a compiled language.   Lots of things in shell involve running
other programs, and running another program usually involves large numbers
of system calls (including fork() and exec() - two of the most costly that

Write shell scripts to do things where all the time is either spent waiting
for something to happen (like the user to type the next command) or in
some other program that the shell runs (like a compiler, or document processor)
and no-one cares just how efficient the shell might be in making all of
that happen, as in the overall scheme of things it makes no difference (kind
of like worrying how quickly you can drive down your driveway to get in or
out of your house when the real issue is how long it takes you to get
to/from work).


reply via email to

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