cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.16k stars 3.82k forks source link

descs: catalog cache lookups needlessly allocate (1.42% allocs in oltp_read_only) #135905

Open tbg opened 9 hours ago

tbg commented 9 hours ago

lookupStoreCacheID^1 in oltp_read_only:

image

It looks like we're heap allocating purely because the NameKey for the cache is an interface:

https://github.com/cockroachdb/cockroach/blob/6a7b1e20e70c0ba8e6bb7a42d52512d9437cd75b/pkg/sql/catalog/descriptor.go#L153-L161

This seems unfortunate. We can make a deeper change there or at least pool this particular allocation.

Epic: CRDB-42584

Jira issue: CRDB-44785