Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #14222 > unrolled thread
| Started by | Mike Jonkmans <bashbug@jonkmans.nl> |
|---|---|
| First post | 2018-06-07 09:24 +0200 |
| Last post | 2018-06-07 09:24 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to gnu.bash.bug
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: program gets faster when it outputs more on stderr Mike Jonkmans <bashbug@jonkmans.nl> - 2018-06-07 09:24 +0200
| From | Mike Jonkmans <bashbug@jonkmans.nl> |
|---|---|
| Date | 2018-06-07 09:24 +0200 |
| Subject | Re: program gets faster when it outputs more on stderr |
| Message-ID | <mailman.1391.1528356310.1292.bug-bash@gnu.org> |
On Sat, Mar 10, 2018 at 04:50:22PM -0500, Chet Ramey wrote: > On 3/10/18 9:46 AM, bashbug@jonkmans.nl wrote: > > > Bash Version: 4.4 > > Patch Level: 12 > > Release Status: release > > > > Description: > > When a function is ran in a subshell environment (via backticks), > > the program runs faster when that function also writes to stderr. > > I don't get these results. I ran it a few times out of curiosity, and the > `fast' version ran 2-3 times slower than the `slow' one. Even running it > against a profiling version doesn't show any significant difference in > function calls. > > Your results could be due to many factors: stdio buffering, a scheduler > that biases perceived interactive processes, I/O optimizations. Nothing > to do with bash, though. > When i run the script with realtime prio (as root) via : chrt -r 99 <script> the timings are as expected; more output takes longer. So it is likely the scheduler at work here. I have rewritten my original script with namerefs to pass the result out of the function. This saves a lot of fork/clone calls. It seems to be fast enough to stay in the interactive scheduler regime. Regards, Mike PS Chet, i had already sent you this some time ago. But accidentally not to the mailinglist. -- Mike <bashbug@jonkmans.nl>
Back to top | Article view | gnu.bash.bug
csiph-web