Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign updistsql: pool physical plans #30884
Conversation
jordanlewis
requested review from
solongordon,
asubiotto and
RaduBerinde
Oct 2, 2018
jordanlewis
requested review from
cockroachdb/distsql-prs
as
code owners
Oct 2, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jordanlewis
added some commits
Sep 21, 2018
RaduBerinde
reviewed
Oct 4, 2018
Reviewable status:
complete! 0 of 0 LGTMs obtained
pkg/sql/distsql_physical_planner.go, line 1098 at r2 (raw file):
nPartitions := len(spanPartitions) if cap(p.ResultRouters) >= nPartitions { p.ResultRouters = p.ResultRouters[:nPartitions]
We may be relying on these slices starting out as zero. In this case we are resurrecting the last state. (btw I'd go back and check your other similar changes with this in mind).
I believe that go 1.11 recognizes statements like append(s, make([]T, n)...) and avoids the allocation. So these could all become x = append(x[:0], make([]T, n)...), assuming you're not looking to backport.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jordanlewis
Oct 4, 2018
Member
Yeah I thought I was fastidious about checking for assumptions like that - I must have missed some. Also we de-upgraded from Go 1.11, or else I'd use your syntax.
|
Yeah I thought I was fastidious about checking for assumptions like that - I must have missed some. Also we de-upgraded from Go 1.11, or else I'd use your syntax. |
asubiotto
reviewed
Oct 11, 2018
Reviewed 7 of 7 files at r1, 4 of 4 files at r2.
Reviewable status:complete! 0 of 0 LGTMs obtained
pkg/sql/distsql_physical_planner.go, line 1153 at r2 (raw file):
nTypes = len(n.desc.Columns) } types := p.ResultTypes[:0]
nit: This reslicing is unnecessary I think.
pkg/sql/distsql_physical_planner.go, line 2031 at r2 (raw file):
} var physicalPlanPool = sync.Pool{
I would stick these next to PhysicalPlan.Release
jordanlewis commentedOct 2, 2018
First 2 commits are part of #30607