Skip to content

storage: performance regression in EncodeMVCCKey and EncodeMVCCValue #88818

@nicktrav

Description

@nicktrav

Describe the problem

Currently, on the 22.2 release branch there is a sizable performance regression in EncodeMVCCKey, relative to 22.1:

$ benchstat bench-22.1 bench-22.2
name                                            old time/op  new time/op   delta
EncodeMVCCKey/key=empty/ts=empty-16             9.85ns ± 3%  14.73ns ± 1%  +49.49%  (p=0.000 n=9+7)
EncodeMVCCKey/key=empty/ts=walltime-16          11.7ns ± 2%   12.3ns ± 4%   +5.10%  (p=0.000 n=10+10)
EncodeMVCCKey/key=empty/ts=walltime+logical-16  12.3ns ± 3%   12.6ns ± 4%     ~     (p=0.072 n=10+10)
EncodeMVCCKey/key=empty/ts=all-16               12.5ns ± 2%   12.7ns ± 4%     ~     (p=0.315 n=8+10)
EncodeMVCCKey/key=short/ts=all-16               13.0ns ± 2%   12.8ns ± 4%     ~     (p=0.247 n=10+10)
EncodeMVCCKey/key=short/ts=empty-16             10.3ns ± 4%   15.0ns ± 3%  +45.29%  (p=0.000 n=10+10)
EncodeMVCCKey/key=short/ts=walltime-16          11.9ns ± 1%   12.7ns ± 4%   +6.61%  (p=0.000 n=9+10)
EncodeMVCCKey/key=short/ts=walltime+logical-16  12.7ns ± 4%   12.8ns ± 4%     ~     (p=0.579 n=10+10)
EncodeMVCCKey/key=long/ts=all-16                36.7ns ± 2%   37.8ns ± 4%   +3.08%  (p=0.013 n=9+10)
EncodeMVCCKey/key=long/ts=empty-16              36.1ns ± 4%   39.2ns ± 2%   +8.63%  (p=0.000 n=10+10)
EncodeMVCCKey/key=long/ts=walltime-16           37.1ns ± 4%   38.0ns ± 2%   +2.41%  (p=0.015 n=10+10)
EncodeMVCCKey/key=long/ts=walltime+logical-16   37.8ns ± 3%   37.8ns ± 3%     ~     (p=0.353 n=10+10)

The above was generated by comparing benchmark results between 22.1 (9eb4da2) to 22.2 (054f32b), via the following:

$ ./dev bench ./pkg/storage --filter EncodeMVCCKey --count 10 -v --stream-output

Jira issue: CRDB-19971

Epic CRDB-2624

Metadata

Metadata

Assignees

Labels

A-storageRelating to our storage engine (Pebble) on-disk storage.C-performancePerf of queries or internals. Solution not expected to change functional behavior.GA-blockerT-storageStorage Teambranch-release-22.2Used to mark GA and release blockers, technical advisories, and bugs for 22.2

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions