Skip to content

perf(schema): tighten PredicatesToDelete allocation#9723

Open
shaunpatterson wants to merge 1 commit into
dgraph-io:mainfrom
shaunpatterson:perf/schema-predstodelete
Open

perf(schema): tighten PredicatesToDelete allocation#9723
shaunpatterson wants to merge 1 commit into
dgraph-io:mainfrom
shaunpatterson:perf/schema-predstodelete

Conversation

@shaunpatterson
Copy link
Copy Markdown
Contributor

Early-return nil when the predicate is absent, return []string{pred} (exact size) for the common case, and pre-size to cap 4 only for the VFLOAT-vector branch (base + 3 sidecar preds).

BenchmarkPredicatesToDelete: vector 92n→58n (6→4 allocs); string -15% time, no B/op regression.


Independent change; branched from 4b9b399d. Verified: package unit tests pass + Go benchmark (benchstat, p<0.01). Single-thread microbenchmarks; not yet run through the Docker integration suite.

Early-return nil when the predicate is absent, return []string{pred} (exact
size) for the common case, and pre-size to cap 4 only for the VFLOAT-vector
branch (base + 3 sidecar preds).

BenchmarkPredicatesToDelete: vector 92n->58n (6->4 allocs); string -15% time.
@shaunpatterson shaunpatterson requested a review from a team as a code owner May 28, 2026 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant