Skip to content

Commit

Permalink
Merge #56791
Browse files Browse the repository at this point in the history
56791: sql: rearrange fields in miscellaneous structs to reduce memory usage r=yuzefovich a=yuzefovich

This commit simply moves around fields in several structs throughout the
sql directory in order to reduce the amount of padding required to get
the alignment fields. All of these optimizations have been found by
using github.com/orijtech/structslop tool. As a result of this code
movement, most of the modified structs moved into a smaller object size
class (the exceptions are some variations of the generated structs in
colexec which didn't change in size).

Release note: None

Co-authored-by: Yahor Yuzefovich <[email protected]>
  • Loading branch information
craig[bot] and yuzefovich committed Nov 18, 2020
2 parents 2545ace + 2169165 commit a969045
Show file tree
Hide file tree
Showing 11 changed files with 328 additions and 315 deletions.
16 changes: 8 additions & 8 deletions pkg/sql/catalog/lease/lease.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,14 +527,6 @@ func (l *descriptorSet) findVersion(version descpb.DescriptorVersion) *descripto
}

type descriptorState struct {
id descpb.ID
stopper *stop.Stopper

// renewalInProgress is an atomic indicator for when a renewal for a
// lease has begun. This is atomic to prevent multiple routines from
// entering renewal initialization.
renewalInProgress int32

mu struct {
syncutil.Mutex

Expand All @@ -559,6 +551,14 @@ type descriptorState struct {
// ignored.
acquisitionsInProgress int
}

stopper *stop.Stopper
id descpb.ID

// renewalInProgress is an atomic indicator for when a renewal for a
// lease has begun. This is atomic to prevent multiple routines from
// entering renewal initialization.
renewalInProgress int32
}

// ensureVersion ensures that the latest version >= minVersion. It will
Expand Down
Loading

0 comments on commit a969045

Please sign in to comment.