Re: cut loadable outputs extra newlines

2022-08-15 Thread Chet Ramey

On 8/13/22 10:06 PM, Martin D Kealey wrote:
I note that 
https://pubs.opengroup.org/onlinepubs/009696699/utilities/cut.html 
 says:
/> The elements in list can be repeated, can overlap, and can be specified 
in any order, but the bytes, characters, or fields selected shall be 
written in the order of the input data./


The intention behind this is so that cut can be implemented as a small 
state machine using just getchar, putchar, and a counter. 


I wrote `lcut' first, then adapted it for `cut'.

This avoids 
copying via a line buffer, and that implies there should be no line-length 
limit.


zgetline has no line length limit.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/




Performances comparission between 5.1 and 5.2.

2022-08-15 Thread felix
Configuration Information:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -g -O2
uname output: Linux medium 5.10.0-12-amd64 #1 SMP Debian 5.10.103-1 
(2022-03-07) x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 5.2
Patch Level: 0
Release Status: rc2

Description:
Trying some script under 5.2 beta, rc1 and rc2, I was surprised by 
execution time.
In order to compare, I've tried to establish execution time of 
elementar operations, like:

 - {0..999}.`: {0..999}`
 - 3x{0..9} `: {0..9}{0..9}{0..9}`
 - readUt   `read -r ut idl https://f-hauri.ch/vrac/timedTest.sh.txt
https://f-hauri.ch/vrac/looptest.sh.txt

-- 
 Félix Hauri  --  http://www.f-hauri.ch



Re: Performances comparission between 5.1 and 5.2.

2022-08-15 Thread Greg Wooledge
On Mon, Aug 15, 2022 at 07:05:49PM +0200, felix wrote:
> Description:
>   Trying some script under 5.2 beta, rc1 and rc2, I was surprised by 
> execution time.

Pre-release versions of bash are built with extra debugging stuff, and
will not perform like full-release versions.



Re: Performances comparission between 5.1 and 5.2.

2022-08-15 Thread Alex fxmbsw7 Ratchev
catastrophal numbers, ..

On Mon, Aug 15, 2022, 19:06 felix  wrote:

> Configuration Information:
> Machine: x86_64
> OS: linux-gnu
> Compiler: gcc
> Compilation CFLAGS: -g -O2
> uname output: Linux medium 5.10.0-12-amd64 #1 SMP Debian 5.10.103-1
> (2022-03-07) x86_64 GNU/Linux
> Machine Type: x86_64-pc-linux-gnu
>
> Bash Version: 5.2
> Patch Level: 0
> Release Status: rc2
>
> Description:
> Trying some script under 5.2 beta, rc1 and rc2, I was surprised by
> execution time.
> In order to compare, I've tried to establish execution time of
> elementar operations, like:
>
>  - {0..999}.`: {0..999}`
>  - 3x{0..9} `: {0..9}{0..9}{0..9}`
>  - readUt   `read -r ut idl   - RE   `[[ $cnt =~ ^[0-9]*\..*$ ]]`
>  - InLneStr `: <<<"Hello world!"`
>  - IncInt   `int+=1`
>  - AccessRt `: "$EPOCHREALTIME"`
>  - PrintF   `printf -v int '%s+%s' $int 1`
>
> Here is results of my comparission between different version of
> bash:
> (1st column show number of empty loop in 0.2 seconds as reference)
> $ for((i=0;i<${#bashs[@]};i++)){ ${bashs[i]} timedTest.sh
> ${args[i]:--q};}
>   l/.2s{0..999}3x{0..9}  readUt  RE
> InLneStr  IncIntAccessRt  PrintF  VersionBuildDir
>   66222  330.31  338.28   13.17   19.02
>  63.160.082.691.18  5.0.17(1)-release
> /tmp/bash/bash-5.0/bash
>   73720  366.97  379.70   13.20   17.80
>  10.090.102.461.19  5.1.4(1)-release   /bin/bash
>   60585  409.92  419.53   13.62   19.87
>  10.870.093.001.38  5.1.4(1)-release
>  /tmp/bash/bash-5.1.4/bash
>   62416  417.85  423.23   14.63   20.84
>  11.340.363.051.43  5.1.4(1)-release
>  /tmp/bash/bash-5.1.4/bash_dynlib
>   62538  416.97  439.28   13.65   20.69
>  12.510.293.051.57  5.1.4(1)-release
>  /tmp/bash/debian/bash-5.1/bash
>   60664  419.54  425.89   14.25   21.05
>  11.010.573.121.38  5.1.16(1)-release
> /tmp/bash/bash-5.1.16/bash
>   4080839995.1039995.10   18.49   35.46
>  15.650.345.812.40  5.2.0(1)-beta
> /tmp/bash/bash-5.2-beta/bash
>   4013433328.3539995.02   18.88   31.18
>  14.730.296.192.20  5.2.0(1)-rc1
>  /tmp/bash/bash-5.2-rc1/bash
>   4035039995.0439995.04   19.10   32.20
>  14.660.596.152.26  5.2.0(1)-rc2
>  /tmp/bash/bash-5.2-rc2/bash
>
> Where if everything seem slower, accessing $EPOCHREALTIME like
> `prinf -v INTEGER '%s+%s' $INTEGER 1` or
> using Regular Expression use approx 2x more time, but a sequence
> of 1000 using brace expansion require 100x more time!!
>
> Another test (first script I wrote) is something slower, but
> render approx same results:
> $ for((i=0;i<${#bashs[@]};i++)){ ${bashs[i]} looptest.sh
> ${args[i]:--q};}
>  l/.02s{0..999}3x{0..9}  readUt  RE
> InLneStr  IncIntAccessRt  PrintF  VersionBuildDir
>1468  340.47  348.36   16.71   22.54
>  51.441.715.103.51  5.0.17(1)-release  bash-5.0/bash
>1714  366.64  380.21   15.11   20.11
>  12.231.333.992.35  5.1.4(1)-release   /bin/bash
>1074  414.53  423.91   15.91   22.94
>  12.781.724.772.54  5.1.4(1)-release
>  bash-5.1.4/bash
>1444  413.59  418.95   16.80   22.83
>  13.211.704.712.51  5.1.4(1)-release
>  bash-5.1.4/bash_dynlib
>1360  421.20  432.83   16.33   22.79
>  12.981.824.872.59  5.1.4(1)-release
>  debian/bash-5.1/bash
>1134  420.00  428.62   16.76   22.74
>  13.121.784.922.60  5.1.16(1)-release
> bash-5.1.16/bash
> 68740158.2140676.12   23.73   38.81
>  18.983.969.873.94  5.2.0(1)-beta
> bash-5.2-beta/bash
> 60739559.7140192.35   23.38   37.68
>  19.083.959.983.99  5.2.0(1)-rc1
>  bash-5.2-rc1/bash
> 74040531.7640965.16   24.38   37.99
>  19.133.94   10.053.95  5.2.0(1)-rc2
>  bash-5.2-rc2/bash
>
> Repeat-By:
> https://f-hauri.ch/vrac/timedTest.sh.txt
> https://f-hauri.ch/vrac/looptest.sh.txt
>
> --
>  Félix Hauri  --  http://www.f-hauri.ch
>
>


Re: Performances comparission between 5.1 and 5.2.

2022-08-15 Thread Eduardo Bustamante
On Mon, Aug 15, 2022 at 10:09 AM Greg Wooledge  wrote:

> On Mon, Aug 15, 2022 at 07:05:49PM +0200, felix wrote:
> > Description:
> >   Trying some script under 5.2 beta, rc1 and rc2, I was surprised by
> execution time.
>
> Pre-release versions of bash are built with extra debugging stuff, and
> will not perform like full-release versions.
>

Chet explains this in
https://lists.gnu.org/archive/html/bug-bash/2014-01/msg00126.html


Re: Performances comparission between 5.1 and 5.2.

2022-08-15 Thread Alex fxmbsw7 Ratchev
On Mon, Aug 15, 2022, 21:42 Eduardo Bustamante  wrote:

> On Mon, Aug 15, 2022 at 10:09 AM Greg Wooledge  wrote:
>
> > On Mon, Aug 15, 2022 at 07:05:49PM +0200, felix wrote:
> > > Description:
> > >   Trying some script under 5.2 beta, rc1 and rc2, I was surprised
> by
> > execution time.
> >
> > Pre-release versions of bash are built with extra debugging stuff, and
> > will not perform like full-release versions.
> >
>
> Chet explains this in
> https://lists.gnu.org/archive/html/bug-bash/2014-01/msg00126.html


thank you sir
by chance, how to disable all suches .. ?

>
>