Re: [go-nuts] Congrats to the Go team

2024-04-27 Thread Robert Engels
Yes. It is this https://github.com/robaho/fixed/blob/5493e8737df761ffcf6be9441b4b8ae41fcf5da4/fixed_bench_test.go#L10On Apr 27, 2024, at 10:31 AM, Steven Hartland  wrote:Do you have the test code for that specific test?That would allow others to have a look at it and also confirm if the test is somehow optimising the function call away.On Sat, 27 Apr 2024 at 05:12, robert engels  wrote:Apologies. The assembly files were reversed. But the timings remain the same.I will get the assembly of the test compiles tomorrow  - but if these differ - that suggests that the test harness between versions has changed as well - meaning can’t compare benchmark performances across versions ?Under the assumption that the register passing should be more efficient than the stack passing.On Apr 26, 2024, at 10:32 PM, Robert Engels  wrote:Why would it be optimized away in 1.12 and not optimized away in 1.21?I could have made a mistake in my recording so I’ll test it again tomorrow. On Apr 26, 2024, at 10:03 PM, 'Keith Randall' via golang-nuts  wrote:Isn't that assembly exactly the opposite? The code that is passing in registers should be 1.21, the one passing on the stack would be 1.12. At least, that's what should be the case with the register ABI that launched in 1.17 (for amd64).Please post a full program and a full command line you're using, so it is immediately obvious how one would reproduce.Also, the assembly of Fixed.Add isn't the thing I'm curious about. It is the assembly of BenchmarkAddFixed. Fixed.Add will probably be inlined into that function, and possibly optimized away.On Friday, April 26, 2024 at 5:44:01 AM UTC-7 robert engels wrote:There seems to be a material difference in the generated code.The function is:func (f Fixed) Add(f0 Fixed) Fixed {    if f.IsNaN() || f0.IsNaN() {        return NaN    }    return Fixed{fp: f.fp + f0.fp}}In 1.12 it appears to place the receiver and the argument in the AX and BX registers as a calling convention, but in 1.21 these are passed on the stack.1.12 assembly:github.com/robaho/fixed.Fixed.Add STEXT nosplit size=33 args=0x10 locals=0x0 funcid=0x0 align=0x0	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	TEXT	github.com/robaho/fixed.Fixed.Add(SB), NOSPLIT|NOFRAME|ABIInternal, $0-16	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	FUNCDATA	$0, gclocals·g2BeySu+wFnoycgXfElmcg==(SB)	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	FUNCDATA	$1, gclocals·g2BeySu+wFnoycgXfElmcg==(SB)	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	FUNCDATA	$5, github.com/robaho/fixed.Fixed.Add.arginfo1(SB)	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	FUNCDATA	$6, github.com/robaho/fixed.Fixed.Add.argliveinfo(SB)	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	PCDATA	$3, $1	0x 0 ()	NOP	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	XCHGL	AX, AX	0x0001 1 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:144)	MOVQ	$9223372036854775807, CX	0x000b 00011 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:144)	CMPQ	AX, CX	0x000e 00014 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:173)	JEQ	21	0x0010 00016 ()	NOP	0x0010 00016 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:144)	CMPQ	BX, CX	0x0013 00019 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:173)	JNE	29	0x0015 00021 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:174)	MOVQ	github.com/robaho/fixed.NaN(SB), AX	0x001c 00028 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:174)	RET	0x001d 00029 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:176)	ADDQ	BX, AX	0x0020 00032 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:176)	RET	0x 90 48 b9 ff ff ff ff ff ff ff 7f 48 39 c8 74 05  .H.H9.t.	0x0010 48 39 cb 75 08 48 8b 05 00 00 00 00 c3 48 01 d8  H9.u.H...H..	0x0020 c3                                               .	rel 24+4 t=14 github.com/robaho/fixed.NaN+01.21.5 assembly:"".Fixed.Add STEXT nosplit size=54 args=0x18 locals=0x0	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	TEXT	"".Fixed.Add(SB), NOSPLIT|ABIInternal, $0-24	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	FUNCDATA	$0, gclocals·33cdeebe80329f1fdbee7f5874cb(SB)	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	FUNCDATA	$1, gclocals·33cdeebe80329f1fdbee7f5874cb(SB)	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	FUNCDATA	$3, gclocals·33cdeebe80329f1fdbee7f5874cb(SB)	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:173)	PCDATA	$2, $0	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:173)	

Re: [go-nuts] Congrats to the Go team

2024-04-27 Thread Steven Hartland
Do you have the test code for that specific test?

That would allow others to have a look at it and also confirm if the test
is somehow optimising the function call away.

On Sat, 27 Apr 2024 at 05:12, robert engels  wrote:

> Apologies. The assembly files were reversed. But the timings remain the
> same.
>
> I will get the assembly of the test compiles tomorrow  - but if these
> differ - that suggests that the test harness between versions has changed
> as well - meaning can’t compare benchmark performances across versions ?
>
> Under the assumption that the register passing should be more efficient
> than the stack passing.
>
> On Apr 26, 2024, at 10:32 PM, Robert Engels  wrote:
>
> Why would it be optimized away in 1.12 and not optimized away in 1.21?
>
> I could have made a mistake in my recording so I’ll test it again
> tomorrow.
>
> On Apr 26, 2024, at 10:03 PM, 'Keith Randall' via golang-nuts <
> golang-nuts@googlegroups.com> wrote:
>
> Isn't that assembly exactly the opposite? The code that is passing in
> registers should be 1.21, the one passing on the stack would be 1.12. At
> least, that's what should be the case with the register ABI that launched
> in 1.17 (for amd64).
> Please post a full program and a full command line you're using, so it is
> immediately obvious how one would reproduce.
>
> Also, the assembly of Fixed.Add isn't the thing I'm curious about. It is
> the assembly of BenchmarkAddFixed. Fixed.Add will probably be inlined into
> that function, and possibly optimized away.
>
> On Friday, April 26, 2024 at 5:44:01 AM UTC-7 robert engels wrote:
>
>> There seems to be a material difference in the generated code.
>>
>> The function is:
>>
>> func (f Fixed) Add(f0 Fixed) Fixed {
>> if f.IsNaN() || f0.IsNaN() {
>> return NaN
>> }
>> return Fixed{fp: f.fp + f0.fp}
>> }
>>
>> In 1.12 it appears to place the receiver and the argument in the AX and
>> BX registers as a calling convention, but in 1.21 these are passed on the
>> stack.
>>
>> 1.12 assembly:
>>
>> github.com/robaho/fixed.Fixed.Add STEXT nosplit size=33 args=0x10
>> locals=0x0 funcid=0x0 align=0x0
>> 0x 0 (/Users/robertengels/go/src/
>> github.com/robaho/fixed/fixed.go:172) TEXT
>> github.com/robaho/fixed.Fixed.Add(SB), NOSPLIT|NOFRAME|ABIInternal, $0-16
>> 0x 0 (/Users/robertengels/go/src/
>> github.com/robaho/fixed/fixed.go:172) FUNCDATA $0,
>> gclocals·g2BeySu+wFnoycgXfElmcg==(SB)
>> 0x 0 (/Users/robertengels/go/src/
>> github.com/robaho/fixed/fixed.go:172) FUNCDATA $1,
>> gclocals·g2BeySu+wFnoycgXfElmcg==(SB)
>> 0x 0 (/Users/robertengels/go/src/
>> github.com/robaho/fixed/fixed.go:172) FUNCDATA $5,
>> github.com/robaho/fixed.Fixed.Add.arginfo1(SB)
>> 0x 0 (/Users/robertengels/go/src/
>> github.com/robaho/fixed/fixed.go:172) FUNCDATA $6,
>> github.com/robaho/fixed.Fixed.Add.argliveinfo(SB)
>> 0x 0 (/Users/robertengels/go/src/
>> github.com/robaho/fixed/fixed.go:172) PCDATA $3, $1
>> 0x 0 () NOP
>> 0x 0 (/Users/robertengels/go/src/
>> github.com/robaho/fixed/fixed.go:172) XCHGL AX, AX
>> 0x0001 1 (/Users/robertengels/go/src/
>> github.com/robaho/fixed/fixed.go:144) MOVQ $9223372036854775807, CX
>> 0x000b 00011 (/Users/robertengels/go/src/
>> github.com/robaho/fixed/fixed.go:144) CMPQ AX, CX
>> 0x000e 00014 (/Users/robertengels/go/src/
>> github.com/robaho/fixed/fixed.go:173) JEQ 21
>> 0x0010 00016 () NOP
>> 0x0010 00016 (/Users/robertengels/go/src/
>> github.com/robaho/fixed/fixed.go:144) CMPQ BX, CX
>> 0x0013 00019 (/Users/robertengels/go/src/
>> github.com/robaho/fixed/fixed.go:173) JNE 29
>> 0x0015 00021 (/Users/robertengels/go/src/
>> github.com/robaho/fixed/fixed.go:174) MOVQ github.com/robaho/fixed.NaN(SB),
>> AX
>> 0x001c 00028 (/Users/robertengels/go/src/
>> github.com/robaho/fixed/fixed.go:174) RET
>> 0x001d 00029 (/Users/robertengels/go/src/
>> github.com/robaho/fixed/fixed.go:176) ADDQ BX, AX
>> 0x0020 00032 (/Users/robertengels/go/src/
>> github.com/robaho/fixed/fixed.go:176) RET
>> 0x 90 48 b9 ff ff ff ff ff ff ff 7f 48 39 c8 74 05  .H.H9.t.
>> 0x0010 48 39 cb 75 08 48 8b 05 00 00 00 00 c3 48 01 d8  H9.u.H...H..
>> 0x0020 c3   .
>> rel 24+4 t=14 github.com/robaho/fixed.NaN+0
>>
>> 1.21.5 assembly:
>>
>> "".Fixed.Add STEXT nosplit size=54 args=0x18 locals=0x0
>> 0x 0 (/Users/robertengels/go/src/
>> github.com/robaho/fixed/fixed.go:172) TEXT "".Fixed.Add(SB),
>> NOSPLIT|ABIInternal, $0-24
>> 0x 0 (/Users/robertengels/go/src/
>> github.com/robaho/fixed/fixed.go:172) FUNCDATA $0,
>> gclocals·33cdeebe80329f1fdbee7f5874cb(SB)
>> 0x 0 (/Users/robertengels/go/src/
>> github.com/robaho/fixed/fixed.go:172) FUNCDATA $1,
>> gclocals·33cdeebe80329f1fdbee7f5874cb(SB)
>> 0x 0 (/Users/robertengels/go/src/
>> github.com/robaho/fixed/fixed.go:172) FUNCDATA $3,
>> gclocals·33cdeebe80329f1fdbee7f5874cb(SB)
>> 0x 0 (/Users/robertengels/

Re: [go-nuts] Congrats to the Go team

2024-04-26 Thread Robert Engels
Why would it be optimized away in 1.12 and not optimized away in 1.21?I could have made a mistake in my recording so I’ll test it again tomorrow. On Apr 26, 2024, at 10:03 PM, 'Keith Randall' via golang-nuts  wrote:Isn't that assembly exactly the opposite? The code that is passing in registers should be 1.21, the one passing on the stack would be 1.12. At least, that's what should be the case with the register ABI that launched in 1.17 (for amd64).Please post a full program and a full command line you're using, so it is immediately obvious how one would reproduce.Also, the assembly of Fixed.Add isn't the thing I'm curious about. It is the assembly of BenchmarkAddFixed. Fixed.Add will probably be inlined into that function, and possibly optimized away.On Friday, April 26, 2024 at 5:44:01 AM UTC-7 robert engels wrote:There seems to be a material difference in the generated code.The function is:func (f Fixed) Add(f0 Fixed) Fixed {    if f.IsNaN() || f0.IsNaN() {        return NaN    }    return Fixed{fp: f.fp + f0.fp}}In 1.12 it appears to place the receiver and the argument in the AX and BX registers as a calling convention, but in 1.21 these are passed on the stack.1.12 assembly:github.com/robaho/fixed.Fixed.Add STEXT nosplit size=33 args=0x10 locals=0x0 funcid=0x0 align=0x0	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	TEXT	github.com/robaho/fixed.Fixed.Add(SB), NOSPLIT|NOFRAME|ABIInternal, $0-16	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	FUNCDATA	$0, gclocals·g2BeySu+wFnoycgXfElmcg==(SB)	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	FUNCDATA	$1, gclocals·g2BeySu+wFnoycgXfElmcg==(SB)	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	FUNCDATA	$5, github.com/robaho/fixed.Fixed.Add.arginfo1(SB)	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	FUNCDATA	$6, github.com/robaho/fixed.Fixed.Add.argliveinfo(SB)	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	PCDATA	$3, $1	0x 0 ()	NOP	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	XCHGL	AX, AX	0x0001 1 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:144)	MOVQ	$9223372036854775807, CX	0x000b 00011 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:144)	CMPQ	AX, CX	0x000e 00014 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:173)	JEQ	21	0x0010 00016 ()	NOP	0x0010 00016 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:144)	CMPQ	BX, CX	0x0013 00019 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:173)	JNE	29	0x0015 00021 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:174)	MOVQ	github.com/robaho/fixed.NaN(SB), AX	0x001c 00028 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:174)	RET	0x001d 00029 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:176)	ADDQ	BX, AX	0x0020 00032 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:176)	RET	0x 90 48 b9 ff ff ff ff ff ff ff 7f 48 39 c8 74 05  .H.H9.t.	0x0010 48 39 cb 75 08 48 8b 05 00 00 00 00 c3 48 01 d8  H9.u.H...H..	0x0020 c3                                               .	rel 24+4 t=14 github.com/robaho/fixed.NaN+01.21.5 assembly:"".Fixed.Add STEXT nosplit size=54 args=0x18 locals=0x0	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	TEXT	"".Fixed.Add(SB), NOSPLIT|ABIInternal, $0-24	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	FUNCDATA	$0, gclocals·33cdeebe80329f1fdbee7f5874cb(SB)	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	FUNCDATA	$1, gclocals·33cdeebe80329f1fdbee7f5874cb(SB)	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:172)	FUNCDATA	$3, gclocals·33cdeebe80329f1fdbee7f5874cb(SB)	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:173)	PCDATA	$2, $0	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:173)	PCDATA	$0, $0	0x 0 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:173)	XCHGL	AX, AX	0x0001 1 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:173)	MOVQ	"".f+8(SP), AX	0x0006 6 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:144)	MOVQ	$9223372036854775807, CX	0x0010 00016 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:144)	CMPQ	AX, CX	0x0013 00019 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:173)	JNE	34	0x0015 00021 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:174)	MOVQ	"".NaN(SB), AX	0x001c 00028 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:174)	MOVQ	AX, "".~r1+24(SP)	0x0021 00033 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:174)	RET	0x0022 00034 (/Users/robertengels/go/src/github.com/robaho/fixed/fixed.go:173)	XCHGL	AX, AX	0x0023 00035 (/Users/robertengels/go/s

Re: [go-nuts] Congrats to the Go team

2024-04-26 Thread Robert Engels
I agree but in this case it is very consistent. Even if that were the case, wouldn’t that mean that 1.12 had better optimization in this case?I will dig in today and report back with the generated code. On Apr 26, 2024, at 12:17 AM, 'Keith Randall' via golang-nuts  wrote:> There is a pretty significant degradation in AddFixed() which may be concerning to the Go teamWhat is the benchmark for this?I am usually suspicious of sub-nanosecond benchmark times. Generally that indicates that the benchmark completely optimized away and all you are measuring is an empty loop.Hard to know for sure without looking at the generated code for BenchmarkAddFixed.On Thursday, April 25, 2024 at 10:54:42 AM UTC-7 Robert Engels wrote:There is a pretty significant degradation in AddFixed() which may be concerning to the Go team, because the code of AddFixed is simply:// Add adds f0 to f producing a Fixed. If either operand is NaN, NaN is returnedfunc (f Fixed) Add(f0 Fixed) Fixed {    if f.IsNaN() || f0.IsNaN() {        return NaN    }    return Fixed{fp: f.fp + f0.fp}}Here is the combined output: │ go1.12.17.txt │ go1.21.5.txt │ go1.22.2.txt │  │sec/op │sec/op  vs base   │sec/op  vs base   │ AddFixed-8 0.6000n ±  2%   0.9593n ±  1%  +59.89% (p=0.002 n=6)   0.8012n ± 12%  +33.53% (p=0.002 n=6)   AddDecimal-8   246.00n ±  1%66.47n ± 14%  -72.98% (p=0.002 n=6)66.23n ±  1%  -73.08% (p=0.002 n=6)   AddBigInt-814.400n ±  1%9.560n ±  2%  -33.61% (p=0.002 n=6)9.525n ±  7%  -33.85% (p=0.002 n=6)   AddBigFloat-8   79.90n ±  3%63.09n ±  0%  -21.03% (p=0.002 n=6)66.20n ±  1%  -17.15% (p=0.002 n=6)   MulFixed-8  4.950n ±  3%3.512n ±  0%  -29.04% (p=0.002 n=6)3.809n ±  2%  -23.06% (p=0.002 n=6)   MulDecimal-873.45n ±  3%65.90n ±  0%  -10.29% (p=0.002 n=6)67.20n ±  1%   -8.52% (p=0.002 n=6)   MulBigInt-8 17.45n ±  1%10.38n ±  2%  -40.52% (p=0.002 n=6)10.43n ±  1%  -40.23% (p=0.002 n=6)   MulBigFloat-8   36.00n ±  2%23.85n ±  1%  -33.75% (p=0.002 n=6)24.00n ±  1%  -33.35% (p=0.002 n=6)   DivFixed-8  4.700n ±  1%3.689n ±  1%  -21.51% (p=0.002 n=6)3.695n ±  2%  -21.39% (p=0.002 n=6)   DivDecimal-8767.0n ± 11%462.9n ±  0%  -39.65% (p=0.002 n=6)470.4n ±  4%  -38.68% (p=0.002 n=6)   DivBigInt-8 45.25n ±  1%34.68n ± 10%  -23.36% (p=0.002 n=6)34.98n ±  1%  -22.70% (p=0.002 n=6)   DivBigFloat-8   108.0n ±  1%110.8n ±  0%   +2.64% (p=0.002 n=6)113.6n ±  0%   +5.19% (p=0.002 n=6)   CmpFixed-8 0.3800n ±  3%   0.2500n ±  1%  -34.22% (p=0.002 n=6)   0.2511n ±  1%  -33.92% (p=0.002 n=6)   CmpDecimal-87.925n ±  1%6.942n ±  1%  -12.40% (p=0.002 n=6)6.503n ±  1%  -17.94% (p=0.002 n=6)  

Re: [go-nuts] Congrats to the Go team

2024-04-25 Thread 'Keith Randall' via golang-nuts
> There is a pretty significant degradation in AddFixed() which may be 
concerning to the Go team

What is the benchmark for this?
I am usually suspicious of sub-nanosecond benchmark times. Generally that 
indicates that the benchmark completely optimized away and all you are 
measuring is an empty loop.
Hard to know for sure without looking at the generated code for 
BenchmarkAddFixed.

On Thursday, April 25, 2024 at 10:54:42 AM UTC-7 Robert Engels wrote:

> There is a pretty significant degradation in AddFixed() which may be 
> concerning to the Go team, because the code 
> 
>  of 
> AddFixed is simply:
>
> // Add adds f0 to f producing a Fixed. If either operand is NaN, NaN is 
> returned
> func (f Fixed) Add(f0 Fixed) Fixed {
> if f.IsNaN() || f0.IsNaN() {
> return NaN
> }
> return Fixed{fp: f.fp + f0.fp}
> }
>
> Here is the combined output:
>
>  │ go1.12.17.txt │ go1.21.5.txt │ 
> go1.22.2.txt │
>   
>
>  │sec/op │sec/op  vs base   │
> sec/op  vs base   │   
>   
> 
> AddFixed-8 0.6000n ±  2%   0.9593n ±  1%  +59.89% (p=0.002 n=6)   
> 0.8012n ± 12%  +33.53% (p=0.002 n=6)  
>   
>
> AddDecimal-8   246.00n ±  1%66.47n ± 14%  -72.98% (p=0.002 n=6)
> 66.23n ±  1%  -73.08% (p=0.002 n=6)   
>   
>   
> AddBigInt-814.400n ±  1%9.560n ±  2%  -33.61% (p=0.002 n=6)
> 9.525n ±  7%  -33.85% (p=0.002 n=6)   
>   
>   
> AddBigFloat-8   79.90n ±  3%63.09n ±  0%  -21.03% (p=0.002 n=6)
> 66.20n ±  1%  -17.15% (p=0.002 n=6)   
>   
>   
> MulFixed-8  4.950n ±  3%3.512n ±  0%  -29.04% (p=0.002 n=6)
> 3.809n ±  2%  -23.06% (p=0.002 n=6)   
>   
>   
> MulDecimal-873.45n ±  3%65.90n ±  0%  -10.29% (p=0.002 n=6)
> 67.20n ±  1%   -8.52% (p=0.002 n=6)   
>   
>   
> MulBigInt-8 17.45n ±  1%10.38n ±  2%  -40.52% (p=0.002 n=6)
> 10.43n ±  1%  -40.23% (p=0.002 n=6)   
>   
>   
> MulBigFloat-8   36.00n ±  2%23.85n ±  1%  -33.75% (p=0.002 n=6)
> 24.00n ±  1%  -33.35% (p=0.002 n=6)   
>   
>   
> DivFixed-8  4.700n ±  1%3.689n ±  1%  -21.51% (p=0.002 n=6)
> 3.695n ±  2%  -21.39% (p=0.002 n=6)   
>   
>   
> DivDecimal-8767.0n ± 11%462.9n ±  0%  -39.65% (p=0.002 n=6)
> 470.4n ±  4%  -38.68% (p=0.002 n=6)   
>   
>   
> DivBigInt-8 45.25n ±  1%34.68n ± 10%  -23.36% (p=0.002 n=6)
> 34.98n ±  1%  -22.70% (p=0.002 n=6)   
>   
>   
> DivBigFloat-8   108.0n ±  1%110.8n ±  0%   +2.64% (p=0.002 n=6)
> 113.6n ±  0%   +5.19% (p=0.002 n=6)   
>   
>   
> CmpFixed-8 0.3800n ±  3%   0.2500n ±  1%  -34.22% (p=0.002 n=6)   
> 0.2511n ±  1%  -33.92% (p=0.002 n=6)  
>   
>
> CmpDecimal-87.925n ±  1%6.942n ±  1% 

Re: [go-nuts] Congrats to the Go team

2024-04-25 Thread 'Robert Engels' via golang-nuts
Thanks. I noticed those but didn’t look into how to address. Appreciate it. I 
will rerun.

> On Apr 25, 2024, at 12:23 PM, Steven Hartland  
> wrote:
> 
> Thanks for these, not sure if you noticed the notes from each run e.g. need 
> >= 4 samples to detect a difference at alpha level 0.05.
> 
> Basically run the benchmark with a -count=6 or more and then run the tool, 
> and you get a the comparison values which are typically the interesting bit
> 
> On Thu, 25 Apr 2024 at 00:29, Robert Engels  > wrote:
>  │ /Users/robertengels/go1.21.5.txt │   
> /Users/robertengels/go1.22.2.txt│ 
>   
>
>  │  sec/op  │sec/op  vs base  
>   │   
>   
>  
> AddFixed-80.9603n ± ∞ ¹   0.7931n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²   
>   
>
> AddDecimal-8   66.41n ± ∞ ¹66.27n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²   
>   
>
> AddBigInt-89.452n ± ∞ ¹   10.650n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²   
>   
>
> AddBigFloat-8  63.26n ± ∞ ¹66.33n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²   
>   
>
> MulFixed-8 3.519n ± ∞ ¹3.939n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²   
>   
>
> MulDecimal-8   65.98n ± ∞ ¹67.07n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²   
>   
>
> MulBigInt-810.69n ± ∞ ¹10.49n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²   
>   
>
> MulBigFloat-8  23.72n ± ∞ ¹24.12n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²   
>   
>
> DivFixed-8 3.675n ± ∞ ¹3.661n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²   
>   
>
> DivDecimal-8   460.8n ± ∞ ¹469.6n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²   
>   
>
> DivBigInt-834.82n ± ∞ ¹34.90n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²   
>   
>
> DivBigFloat-8  110.4n ± ∞ ¹113.6n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²   
>   
>
> CmpFixed-80.2529n ± ∞ ¹   0.2784n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²   
>   
>
> CmpDecimal-8   6.883n ± ∞ ¹6.475n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²   
> 

Re: [go-nuts] Congrats to the Go team

2024-04-25 Thread Steven Hartland
Thanks for these, not sure if you noticed the notes from each run e.g. need
>= 4 samples to detect a difference at alpha level 0.05.

Basically run the benchmark with a -count=6 or more and then run the tool,
and you get a the comparison values which are typically the interesting bit

On Thu, 25 Apr 2024 at 00:29, Robert Engels  wrote:

>  │ /Users/robertengels/go1.21.5.txt │   
> /Users/robertengels/go1.22.2.txt│
>  │  sec/op  │sec/op  vs base  
>   │
> AddFixed-80.9603n ± ∞ ¹   0.7931n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> AddDecimal-8   66.41n ± ∞ ¹66.27n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> AddBigInt-89.452n ± ∞ ¹   10.650n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> AddBigFloat-8  63.26n ± ∞ ¹66.33n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> MulFixed-8 3.519n ± ∞ ¹3.939n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> MulDecimal-8   65.98n ± ∞ ¹67.07n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> MulBigInt-810.69n ± ∞ ¹10.49n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> MulBigFloat-8  23.72n ± ∞ ¹24.12n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> DivFixed-8 3.675n ± ∞ ¹3.661n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> DivDecimal-8   460.8n ± ∞ ¹469.6n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> DivBigInt-834.82n ± ∞ ¹34.90n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> DivBigFloat-8  110.4n ± ∞ ¹113.6n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> CmpFixed-80.2529n ± ∞ ¹   0.2784n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> CmpDecimal-8   6.883n ± ∞ ¹6.475n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> CmpBigInt-84.779n ± ∞ ¹4.805n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> CmpBigFloat-8  4.411n ± ∞ ¹5.081n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> StringFixed-8  50.36n ± ∞ ¹50.64n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> StringNFixed-8 53.41n ± ∞ ¹49.66n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> StringDecimal-8197.6n ± ∞ ¹197.0n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> StringBigInt-8 98.17n ± ∞ ¹98.00n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> StringBigFloat-8   386.2n ± ∞ ¹395.2n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> WriteTo-8  31.82n ± ∞ ¹31.71n ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> geomean22.01n  22.28n+1.26%
> ¹ need >= 6 samples for confidence interval at level 0.95
> ² need >= 4 samples to detect a difference at alpha level 0.05
>   
>   
>   
>   │ 
> /Users/robertengels/go1.21.5.txt │  /Users/robertengels/go1.22.2.txt   │
>  │   B/op   │B/op  vs base
> │
> AddFixed-8  0.000 ± ∞ ¹   0.000 ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> AddDecimal-880.00 ± ∞ ¹   80.00 ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> AddBigInt-8 0.000 ± ∞ ¹   0.000 ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> AddBigFloat-8   48.00 ± ∞ ¹   48.00 ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> MulFixed-8  0.000 ± ∞ ¹   0.000 ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> MulDecimal-880.00 ± ∞ ¹   80.00 ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> MulBigInt-8 0.000 ± ∞ ¹   0.000 ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> MulBigFloat-8   0.000 ± ∞ ¹   0.000 ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> DivFixed-8  0.000 ± ∞ ¹   0.000 ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> DivDecimal-8384.0 ± ∞ ¹   384.0 ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> DivBigInt-8 8.000 ± ∞ ¹   8.000 ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> DivBigFloat-8   24.00 ± ∞ ¹   24.00 ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> CmpFixed-8  0.000 ± ∞ ¹   0.000 ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> CmpDecimal-80.000 ± ∞ ¹   0.000 ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> CmpBigInt-8 0.000 ± ∞ ¹   0.000 ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> CmpBigFloat-8   0.000 ± ∞ ¹   0.000 ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> StringFixed-8   24.00 ± ∞ ¹   24.00 ± ∞ ¹   ~ 
> (p=1.000 n=1) ²
> StringNFixed-8

Re: [go-nuts] Congrats to the Go team

2024-04-24 Thread robert engels
And for the 1.12 vs 1.22:

 │ /Users/robertengels/go1.12.17.txt │
/Users/robertengels/go1.22.2.txt│
 │  sec/op   │sec/op  vs base   
  │
AddFixed-8 0.5900n ± ∞ ¹   0.7931n ± ∞ ¹~ 
(p=1.000 n=1) ²
AddDecimal-8   243.00n ± ∞ ¹66.27n ± ∞ ¹~ 
(p=1.000 n=1) ²
AddBigInt-8 14.30n ± ∞ ¹10.65n ± ∞ ¹~ 
(p=1.000 n=1) ²
AddBigFloat-8   78.80n ± ∞ ¹66.33n ± ∞ ¹~ 
(p=1.000 n=1) ²
MulFixed-8  4.880n ± ∞ ¹3.939n ± ∞ ¹~ 
(p=1.000 n=1) ²
MulDecimal-872.00n ± ∞ ¹67.07n ± ∞ ¹~ 
(p=1.000 n=1) ²
MulBigInt-8 17.10n ± ∞ ¹10.49n ± ∞ ¹~ 
(p=1.000 n=1) ²
MulBigFloat-8   35.50n ± ∞ ¹24.12n ± ∞ ¹~ 
(p=1.000 n=1) ²
DivFixed-8  4.710n ± ∞ ¹3.661n ± ∞ ¹~ 
(p=1.000 n=1) ²
DivDecimal-8779.0n ± ∞ ¹469.6n ± ∞ ¹~ 
(p=1.000 n=1) ²
DivBigInt-8 46.10n ± ∞ ¹34.90n ± ∞ ¹~ 
(p=1.000 n=1) ²
DivBigFloat-8   108.0n ± ∞ ¹113.6n ± ∞ ¹~ 
(p=1.000 n=1) ²
CmpFixed-8 0.3800n ± ∞ ¹   0.2784n ± ∞ ¹~ 
(p=1.000 n=1) ²
CmpDecimal-88.050n ± ∞ ¹6.475n ± ∞ ¹~ 
(p=1.000 n=1) ²
CmpBigInt-8 5.870n ± ∞ ¹4.805n ± ∞ ¹~ 
(p=1.000 n=1) ²
CmpBigFloat-8   5.460n ± ∞ ¹5.081n ± ∞ ¹~ 
(p=1.000 n=1) ²
StringFixed-8   57.40n ± ∞ ¹50.64n ± ∞ ¹~ 
(p=1.000 n=1) ²
StringNFixed-8  55.60n ± ∞ ¹49.66n ± ∞ ¹~ 
(p=1.000 n=1) ²
StringDecimal-8 218.0n ± ∞ ¹197.0n ± ∞ ¹~ 
(p=1.000 n=1) ²
StringBigInt-8 122.00n ± ∞ ¹98.00n ± ∞ ¹~ 
(p=1.000 n=1) ²
StringBigFloat-8416.0n ± ∞ ¹395.2n ± ∞ ¹~ 
(p=1.000 n=1) ²
WriteTo-8   45.80n ± ∞ ¹31.71n ± ∞ ¹~ 
(p=1.000 n=1) ²
geomean 28.48n  22.28n-21.75%
¹ need >= 6 samples for confidence interval at level 0.95
² need >= 4 samples to detect a difference at alpha level 0.05

 │ /Users/robertengels/go1.12.17.txt │  
/Users/robertengels/go1.22.2.txt   │
 │   B/op│B/op  vs base 
   │
AddFixed-8   0.000 ± ∞ ¹   0.000 ± ∞ ¹   ~ 
(p=1.000 n=1) ²
AddDecimal-8176.00 ± ∞ ¹   80.00 ± ∞ ¹   ~ 
(p=1.000 n=1) ³
AddBigInt-8  0.000 ± ∞ ¹   0.000 ± ∞ ¹   ~ 
(p=1.000 n=1) ²
AddBigFloat-848.00 ± ∞ ¹   48.00 ± ∞ ¹   ~ 
(p=1.000 n=1) ²
MulFixed-8   0.000 ± ∞ ¹   0.000 ± ∞ ¹   ~ 
(p=1.000 n=1) ²
MulDecimal-8 80.00 ± ∞ ¹   80.00 ± ∞ ¹   ~ 
(p=1.000 n=1) ²
MulBigInt-8  0.000 ± ∞ ¹   0.000 ± ∞ ¹   ~ 
(p=1.000 n=1) ²
MulBigFloat-80.000 ± ∞ ¹   0.000 ± ∞ ¹   ~ 
(p=1.000 n=1) ²
DivFixed-8   0.000 ± ∞ ¹   0.000 ± ∞ ¹   ~ 
(p=1.000 n=1) ²
DivDecimal-8 568.0 ± ∞ ¹   384.0 ± ∞ ¹   ~ 
(p=1.000 n=1) ³
DivBigInt-8  8.000 ± ∞ ¹   8.000 ± ∞ ¹   ~ 
(p=1.000 n=1) ²
DivBigFloat-824.00 ± ∞ ¹   24.00 ± ∞ ¹   ~ 
(p=1.000 n=1) ²
CmpFixed-8   0.000 ± ∞ ¹   0.000 ± ∞ ¹   ~ 
(p=1.000 n=1) ²
CmpDecimal-8 0.000 ± ∞ ¹   0.000 ± ∞ ¹   ~ 
(p=1.000 n=1) ²
CmpBigInt-8  0.000 ± ∞ ¹   0.000 ± ∞ ¹   ~ 
(p=1.000 n=1) ²
CmpBigFloat-80.000 ± ∞ ¹   0.000 ± ∞ ¹   ~ 
(p=1.000 n=1) ²
StringFixed-832.00 ± ∞ ¹   24.00 ± ∞ ¹   ~ 
(p=1.000 n=1) ³
StringNFixed-8   32.00 ± ∞ ¹   24.00 ± ∞ ¹   ~ 
(p=1.000 n=1) ³
StringDecimal-8  64.00 ± ∞ ¹   56.00 ± ∞ ¹   ~ 
(p=1.000 n=1) ³
StringBigInt-8   24.00 ± ∞ ¹   16.00 ± ∞ ¹   ~ 
(p=1.000 n=1) ³
StringBigFloat-8 192.0 ± ∞ ¹   176.0 ± ∞ ¹   ~ 
(p=1.000 n=1) ³
WriteTo-818.00 ± ∞ ¹   28.00 ± ∞ ¹   ~ 
(p=1.000 n=1) ³
geomean⁴-8.44%  
 ⁴
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ need >= 4 samples to detect a difference at alpha level 0.05
⁴ summaries must be >0 to compute geome

Re: [go-nuts] Congrats to the Go team

2024-04-24 Thread 'Robert Engels' via golang-nuts
 │ /Users/robertengels/go1.21.5.txt │   
/Users/robertengels/go1.22.2.txt│   

   
 │  sec/op  │sec/op  vs base
│   

   
AddFixed-80.9603n ± ∞ ¹   0.7931n ± ∞ ¹   ~ 
(p=1.000 n=1) ² 

   
AddDecimal-8   66.41n ± ∞ ¹66.27n ± ∞ ¹   ~ 
(p=1.000 n=1) ² 

   
AddBigInt-89.452n ± ∞ ¹   10.650n ± ∞ ¹   ~ 
(p=1.000 n=1) ² 

   
AddBigFloat-8  63.26n ± ∞ ¹66.33n ± ∞ ¹   ~ 
(p=1.000 n=1) ² 

   
MulFixed-8 3.519n ± ∞ ¹3.939n ± ∞ ¹   ~ 
(p=1.000 n=1) ² 

   
MulDecimal-8   65.98n ± ∞ ¹67.07n ± ∞ ¹   ~ 
(p=1.000 n=1) ² 

   
MulBigInt-810.69n ± ∞ ¹10.49n ± ∞ ¹   ~ 
(p=1.000 n=1) ² 

   
MulBigFloat-8  23.72n ± ∞ ¹24.12n ± ∞ ¹   ~ 
(p=1.000 n=1) ² 

   
DivFixed-8 3.675n ± ∞ ¹3.661n ± ∞ ¹   ~ 
(p=1.000 n=1) ² 

   
DivDecimal-8   460.8n ± ∞ ¹469.6n ± ∞ ¹   ~ 
(p=1.000 n=1) ² 

   
DivBigInt-834.82n ± ∞ ¹34.90n ± ∞ ¹   ~ 
(p=1.000 n=1) ² 

   
DivBigFloat-8  110.4n ± ∞ ¹113.6n ± ∞ ¹   ~ 
(p=1.000 n=1) ² 

   
CmpFixed-80.2529n ± ∞ ¹   0.2784n ± ∞ ¹   ~ 
(p=1.000 n=1) ² 

   
CmpDecimal-8   6.883n ± ∞ ¹6.475n ± ∞ ¹   ~ 
(p=1.000 n=1) ² 

   
CmpBigInt-84.779n ± ∞ ¹4.805n ± ∞ ¹   ~ 
(p=1.000 n=1) ² 

   
CmpBigFloat-8  4.411n ± ∞ ¹5.081n ± ∞ ¹   ~ 
(p=1.000 n=1) ² 

   
StringFixed-8  50.36n ± ∞

Re: [go-nuts] Congrats to the Go team

2024-04-24 Thread Steven Hartland
What’s it look like when your run it through
https://pkg.go.dev/golang.org/x/perf/cmd/benchstat which will provide a
nice side by side comparison?

On Wed, 24 Apr 2024 at 19:26, 'Robert Engels' via golang-nuts <
golang-nuts@googlegroups.com> wrote:

> I have a fairly stable project github.com/robaho/fixed which is almost
> 100% cpu bound. It doesn’t change so it makes a great way to compare the
> performance of different Go versions using the same hardware. I took the
> time to re-run the tests today.
>
> Using 1.21.17:
>
> BenchmarkAddFixed-8 20   0.59 ns/op   
>  0 B/op  0 allocs/op
> BenchmarkAddDecimal-8500   243 ns/op 
> 176 B/op  8 allocs/op
> BenchmarkAddBigInt-81   14.3 ns/op
>  0 B/op  0 allocs/op
> BenchmarkAddBigFloat-8  200078.8 ns/op
> 48 B/op  1 allocs/op
> BenchmarkMulFixed-8 34.88 ns/op   
>  0 B/op  0 allocs/op
> BenchmarkMulDecimal-8   200072.0 ns/op
> 80 B/op  2 allocs/op
> BenchmarkMulBigInt-81   17.1 ns/op
>  0 B/op  0 allocs/op
> BenchmarkMulBigFloat-8  300035.5 ns/op
>  0 B/op  0 allocs/op
> BenchmarkDivFixed-8 34.71 ns/op   
>  0 B/op  0 allocs/op
> BenchmarkDivDecimal-8200   779 ns/op 
> 568 B/op 21 allocs/op
> BenchmarkDivBigInt-8300046.1 ns/op
>  8 B/op  1 allocs/op
> BenchmarkDivBigFloat-8  2000   108 ns/op  
> 24 B/op  2 allocs/op
> BenchmarkCmpFixed-8 20   0.38 ns/op   
>  0 B/op  0 allocs/op
> BenchmarkCmpDecimal-8   28.05 ns/op   
>  0 B/op  0 allocs/op
> BenchmarkCmpBigInt-835.87 ns/op   
>  0 B/op  0 allocs/op
> BenchmarkCmpBigFloat-8  35.46 ns/op   
>  0 B/op  0 allocs/op
> BenchmarkStringFixed-8  200057.4 ns/op
> 32 B/op  1 allocs/op
> BenchmarkStringNFixed-8 200055.6 ns/op
> 32 B/op  1 allocs/op
> BenchmarkStringDecimal-81000   218 ns/op  
> 64 B/op  5 allocs/op
> BenchmarkStringBigInt-8 1000   122 ns/op  
> 24 B/op  2 allocs/op
> BenchmarkStringBigFloat-8300   416 ns/op 
> 192 B/op  8 allocs/op
> BenchmarkWriteTo-8  300045.8 ns/op
> 18 B/op  0 allocs/op
>
>
> and version 1.21.5:
>
> BenchmarkAddFixed-8 10   0.9735 ns/op 
>  0 B/op  0 allocs/op
> BenchmarkAddDecimal-8   1431199569.99 ns/op   
> 80 B/op  2 allocs/op
> BenchmarkAddBigInt-81   13.42 ns/op   
>  0 B/op  0 allocs/op
> BenchmarkAddBigFloat-8  1750670263.84 ns/op   
> 48 B/op  1 allocs/op
> BenchmarkMulFixed-8 3139831043.732 ns/op  
>  0 B/op  0 allocs/op
> BenchmarkMulDecimal-8   1804652066.59 ns/op   
> 80 B/op  2 allocs/op
> BenchmarkMulBigInt-81   10.79 ns/op   
>  0 B/op  0 allocs/op
> BenchmarkMulBigFloat-8  4918602424.30 ns/op   
>  0 B/op  0 allocs/op
> BenchmarkDivFixed-8 3068880693.721 ns/op  
>  0 B/op  0 allocs/op
> BenchmarkDivDecimal-82510688   462.4 ns/op   
> 384 B/op 12 allocs/op
> BenchmarkDivBigInt-83399382237.02 ns/op   
>  8 B/op  1 allocs/op
> BenchmarkDivBigFloat-8   9415330   111.5 ns/op
> 24 B/op  2 allocs/op
> BenchmarkCmpFixed-8 10   0.2548 ns/op 
>  0 B/op  0 allocs/op
> BenchmarkCmpDecimal-8   1687145497.086 ns/op  
>  0 B/op  0 allocs/op
> BenchmarkCmpBigInt-82348956344.952 ns/op  
>  0 B/op  0 allocs/op
> BenchmarkCmpBigFloat-8  2608144644.503 ns/op  
>  0 B/op  0 allocs/op
> BenchmarkStringFixed-8  2372547050.57 ns/op   
> 24 B/op  1 allocs/op
> BenchmarkStringNFixed-8 232850.67 ns/op  

Re: [go-nuts] Congrats to the Go team

2024-04-24 Thread robert engels
Rough guess, it seems about the same.

1.22.2:

BenchmarkAddFixed-8 10   0.7931 ns/op  
0 B/op  0 allocs/op 

  
BenchmarkAddDecimal-8   1815612066.27 ns/op   
80 B/op  2 allocs/op

   
BenchmarkAddBigInt-81   10.65 ns/op
0 B/op  0 allocs/op 

  
BenchmarkAddBigFloat-8  1810566766.33 ns/op   
48 B/op  1 allocs/op

   
BenchmarkMulFixed-8 2957369673.939 ns/op   
0 B/op  0 allocs/op 

  
BenchmarkMulDecimal-8   1782734067.07 ns/op   
80 B/op  2 allocs/op

   
BenchmarkMulBigInt-81   10.49 ns/op
0 B/op  0 allocs/op 

  
BenchmarkMulBigFloat-8  4965171024.12 ns/op
0 B/op  0 allocs/op 

  
BenchmarkDivFixed-8 3094442373.661 ns/op   
0 B/op  0 allocs/op 

  
BenchmarkDivDecimal-82426755   469.6 ns/op   
384 B/op 12 allocs/op   


BenchmarkDivBigInt-83428970134.90 ns/op
8 B/op  1 allocs/op 

  
BenchmarkDivBigFloat-8   9028243   113.6 ns/op
24 B/op  2 allocs/op

   
BenchmarkCmpFixed-8 10   0.2784 ns/op  
0 B/op  0 allocs/op 

  
BenchmarkCmpDecimal-8   1814675106.475 ns/op   
0 B/op  0 allocs/op 

  
BenchmarkCmpBigInt-82440902524.805 ns/op   
0 B/op  0 allocs/op 

  
BenchmarkCmpBigFloat-8  2568825125.081 ns/op   
0 B/op  0 allocs/op 

  

[go-nuts] Congrats to the Go team

2024-04-24 Thread 'Robert Engels' via golang-nuts
I have a fairly stable project github.com/robaho/fixed 
 which is almost 100% cpu bound. It doesn’t 
change so it makes a great way to compare the performance of different Go 
versions using the same hardware. I took the time to re-run the tests today.

Using 1.21.17:

BenchmarkAddFixed-8 20   0.59 ns/op
0 B/op  0 allocs/op 

  
BenchmarkAddDecimal-8500   243 ns/op 
176 B/op  8 allocs/op   


BenchmarkAddBigInt-81   14.3 ns/op 
0 B/op  0 allocs/op 

  
BenchmarkAddBigFloat-8  200078.8 ns/op
48 B/op  1 allocs/op

   
BenchmarkMulFixed-8 34.88 ns/op
0 B/op  0 allocs/op 

  
BenchmarkMulDecimal-8   200072.0 ns/op
80 B/op  2 allocs/op

   
BenchmarkMulBigInt-81   17.1 ns/op 
0 B/op  0 allocs/op 

  
BenchmarkMulBigFloat-8  300035.5 ns/op 
0 B/op  0 allocs/op 

  
BenchmarkDivFixed-8 34.71 ns/op
0 B/op  0 allocs/op 

  
BenchmarkDivDecimal-8200   779 ns/op 
568 B/op 21 allocs/op   


BenchmarkDivBigInt-8300046.1 ns/op 
8 B/op  1 allocs/op 

  
BenchmarkDivBigFloat-8  2000   108 ns/op  
24 B/op  2 allocs/op

   
BenchmarkCmpFixed-8 20   0.38 ns/op
0 B/op  0 allocs/op 

  
BenchmarkCmpDecimal-8   28.05 ns/op
0 B/op  0 allocs/op 

  
BenchmarkCmpBigInt-835.87 ns/op
0 B/op  0 allocs/op 

  
Be