Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: upgrade to go 1.20 #96443

Closed
ajwerner opened this issue Feb 2, 2023 · 1 comment
Closed

build: upgrade to go 1.20 #96443

ajwerner opened this issue Feb 2, 2023 · 1 comment
Assignees
Labels
A-build-system C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-dev-inf

Comments

@ajwerner
Copy link
Contributor

ajwerner commented Feb 2, 2023

Is your feature request related to a problem? Please describe.

Go 1.20 is out. We generally do like to pick up the upgrades ahead of our major releases. This one is a good one. It has performance improvement in general, compile time improvements, and major improvements to generics. It also may have some good improvements for GC assist.

Additional context
This may help with:

A prerequisite for shipping it would be fixing cockroachdb/errors#99. @ajwerner is committed to doing that work in parallel to the dev-inf work to upgrade go.

Jira issue: CRDB-24129

@ajwerner ajwerner added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-build-system labels Feb 2, 2023
@rickystewart rickystewart self-assigned this Feb 2, 2023
ajwerner added a commit to ajwerner/cockroach that referenced this issue May 31, 2023
There was one field added to the `p` that matters: needspinning
(see golang/go@8cb350d).

All of the relevant symbols and structs were re-copied. Some `uintptr`s
were replaced with real pointers, and some things were ported to use new
atomic types.

Relates to cockroachdb#96443.

Epic: none

Release note: None
craig bot pushed a commit that referenced this issue May 31, 2023
101693: sql: avoid string to byte conversion copies on insert path r=cucaroach a=cucaroach

Originated from: #91930

Incorporate those changes and add a benchmark and add some more changes based on benchmark results.

Broken into several commits:

### json: avoid copying json.AsText where possible
    
Epic: None
Release note: None


### pgwire: avoid some string to byte copies

Most parse routines don't retain the input string pointer so we can
use a pointer to the input bytes in those cases.

Release note: None
Epic: None

### builtins: avoid some []byte to string copies in decode

Release note: None
Epic: None



### valueside: remove string to []byte copies

Release note: None
Epic: None


### colenc: use new UnsafeConvertBytesToString

Cosmetic change to use the new UnsafeConvertBytesToString.

Release note: None
Epic: None



### opt: avoid allocation in DBytes interning

DBytes is a string under the covers but we usually operate on them
with []byte APIs, avoid copies in these cases.

Release note: None
Epic: None


### tree: allow access to DBytes/DString/DEncodedKey raw bytes

Epic: None
Release note: None


### encoding: unsafeString -> UnsafeConvertBytesToString

Make public for use elsewhere.

Release note: None
Epic: None

### lex: avoid some string to byte slice copies

Facilitate some copy avoidance by using []byte instead of string.
Only copy when necessary in some cases.

Release note: None
Epic: None

### bench: add a large insert benchmark

This benchmark shows the reducation in allocations by the copy avoidance
changes.  Together the changes result in:

```
name                                     old time/op    new time/op    delta
SQL/Cockroach/InsertLarge/count=1000-10    18.7ms ± 4%    19.1ms ±26%     ~     (p=0.780 n=9+10)

name                                     old alloc/op   new alloc/op   delta
SQL/Cockroach/InsertLarge/count=1000-10    49.7MB ± 4%    39.7MB ±10%  -20.19%  (p=0.000 n=9+9)

name                                     old allocs/op  new allocs/op  delta
SQL/Cockroach/InsertLarge/count=1000-10     39.0k ± 5%     29.7k ± 8%  -23.83%  (p=0.000 n=10+9)
```

Release note: None
Epic: None


103551: build: make master `v23.2.0-alpha.00000000` r=rickystewart,srosenberg,postamar a=renatolabs

v23.1.1 has been released, `master` should now be considered to be 23.2.

Epic: none

Release note: None

103859: goschedstats: support go1.20 r=rickystewart a=ajwerner

There was one field added to the `p` that matters: needspinning (see golang/go@8cb350d).

All of the relevant symbols and structs were re-copied. Some `uintptr`s were replaced with real pointers, and some things were ported to use new atomic types.

Relates to #96443.

Epic: none

Release note: None

103948: liveness: split liveness cache out r=erikgrinaker a=andrewbaptist

Move the liveness caching methods to a new file.

Only look at the last 2 commits - I will rebase on master once those are merged.

Epic: none

Release note: None


Co-authored-by: Tommy Reilly <[email protected]>
Co-authored-by: Renato Costa <[email protected]>
Co-authored-by: ajwerner <[email protected]>
Co-authored-by: Andrew Baptist <[email protected]>
@RaduBerinde
Copy link
Member

#97260

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build-system C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-dev-inf
Projects
None yet
Development

No branches or pull requests

4 participants