Repository navigation
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
| f docfilter.MembershipFilter | ||
| scratch [8]byte // reused encode buffer for the hot integer-PK path (Test copies out) | ||
| uuidScratch [16]byte // query-owned raw UUID probe before the CGo-safe copy | ||
| uuidProbe *[16]byte // pointer-free backing object passed to CGo filters |
There was a problem hiding this comment.
Is this really an optimization? Why use a pointer? Why not just keep a copy of 16 bytes? It is highly unlikely that holding a pointer is any cheaper than 16 bytes.
There was a problem hiding this comment.
Oh well, seems you are saying this is exactly the purpose of this PR. So my question, do you have a benchmark or profiling that support this?
There was a problem hiding this comment.
Addressed in exact head 3f6b8d2. Added a deterministic pointer-backed versus inline-copy benchmark covering hit, miss and mixed probes, and corrected the canonical membership result delimiters. Local benchmark execution is BLOCKED_ENVIRONMENT because existing docfilter CGo symbols are unavailable; no performance PASS is claimed. Please re-review this head.
| f docfilter.MembershipFilter | ||
| scratch [8]byte // reused encode buffer for the hot integer-PK path (Test copies out) | ||
| uuidScratch [16]byte // query-owned raw UUID probe before the CGo-safe copy | ||
| uuidProbe *[16]byte // pointer-free backing object passed to CGo filters |
There was a problem hiding this comment.
Oh well, seems you are saying this is exactly the purpose of this PR. So my question, do you have a benchmark or profiling that support this?
3802379 to
3f6b8d2
Compare
34b8264 to
69e7589
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
Astra medium deep review at exact head 69e7589.\n\nAPPROVE. No verified P0/P1/P2 finding. The loaded UUID path avoids decode/string/interface boxing while preserving UUID equality and the same 16-byte Bloom hash input; loaded/base/tail behavior, null/duplicate handling, liveness selection, scratch cleanup, and per-query ownership were checked. No new wait, shared mutation, leak, or concurrency defect found.\n\nTests cover accepted representations, Bloom hits/misses, malformed/truncated rows, stale scratch, score preservation, duplicates, streams, and parallel owners. Exact-head CI passed build, Ubuntu UT, SCA, coverage, Proxy BVT, pessimistic BVT, and CI Required; changed membership BVT was 49/49 with zero ignored in 0.41s.\n\nNon-blocking note: benchmark/SQL throughput and cgocheck2 were not independently reproduced; existing #28985 COPY ALTER skip is unrelated to this PR.
aptend
left a comment
There was a problem hiding this comment.
Reviewed exact head 69e7589 against base 5bf6d24. I read the complete six-file diff plus all historical reviews, inline discussion, author replies, and the still-open benchmark thread.
No blocking issue found. The loaded UUID path now parses directly into query-owned, per-segment scratch and exposes pointer-free backing to CGo; the immutable loaded segment, build-side typed fallback, persisted docmap representation, and wire behavior remain unchanged. The tests cover accepted UUID representations, hit/miss/mixed probes, malformed and invalid rows failing closed, exact score/liveness/stream behavior, independent parallel owners, and zero steady-state allocations. BVT covers filter pushdown enabled/disabled.
Exact-head CI is green. Local validation: diff-check/gofmt clean; focused UUID membership tests pass; full ./pkg/fulltext2 passes normally and under -race; TestLoadedUUIDMembershipParallelOwners passes 100 race repetitions. Benchmark shows pointer-backed hit/miss/mixed at 0 B/op and 0 allocs/op versus inline-copy at 16 B/op and 1 alloc/op, with lower latency in each case.
What type of PR is this?
Which issue(s) this PR fixes:
issue #27800
What this PR does / why we need it:
Changes:
pkContentand parse directly from bytes with the existinggoogle/uuidparser.Non-goals:
Validation and real-Bloom benchmark
5bf6d24157959febb839615462c30eafb5046fc9; tested product head:69e7589f3bbb169ba004d8f5f0e6273df4a2f5ea.Builder -> Serialize -> Deserializeloaded UUID segment and UUID runtime-vector Bloom: typed, pointer-backed and local-copy results agree, with no false negatives for inserted UUIDs. Focused normal/race tests, full FULLTEXT2/docfilter package tests, owning-package build/vet and formatting checks passed.Go pointer to unpinned Go pointer). The independent pointer-free backing object and local-copy variants passed ordinary CGo checks.cgocheck2remains blocked before tests bysonic/loader.casModuleinitialization; this is not a safety PASS under that instrumentation.Fresh-wrapper lifecycle benchmark, including first allocation; real Bloom and loaded segment shared outside timing. Mixed-probe medians below use GOMAXPROCS=1, 10 repetitions, 2s per benchmark; values are per lifecycle:
The measured property is steady-state probe allocation avoidance: each wrapper allocates its 16-byte backing storage on first use and reuses it thereafter; this does not mean the entire query or membership lifecycle is allocation-free. The legal local copy escapes through the real CGo probe and allocates per probe. Single-probe local copy uses less memory; at 16 probes the measured times are essentially tied. At 256/4096 probes the pointer-backed medians are about 17–19% lower than local copy and 47–48% lower than typed. GOMAXPROCS=10 and a separate 10-worker benchmark show the same allocation pattern. Direct byte parsing alone measures 0 B/0 allocs versus typed boxing at 64 B/2 allocs.
Independent CPU and allocation/heap profiles support the allocation mechanism: typed decoding/boxing and local-copy per-probe allocation are removed from the steady-state pointer-backed path. CPU profiles were collected separately from allocation instrumentation.
Evidence: mo-55
/home/sunyuze/fulltext2-uuid-28955-20260916T084629Z/artifacts/contains raw 10-run logs,median-summary.tsv, profiles, test exit codes, resource samples and source/native/binary hashes. Test binary SHA256:8591ce22c550753a1cfd1be8227e80ac2e73e3022ca5262fe453c452bd46e681.Limitations: timing is
INCONCLUSIVE_HOST_BUSYbecause shared-host load and swap activity varied. Numbers are descriptive micro medians, not statistically established speedups or SQL throughput claims.benchstatinstallation was blocked by a network timeout; all ten runs were retained and median summaries used. No 2.3M SQL matrix was run.CI and QA
35194357473(generation35194357473-1, head34b82646abb48e24d8bafe97f628fcc1e1ea8970), Build, SCA, Proxy BVT and pessimistic multi-CN BVT completed successfully. The UT Coverage producer exited with code 1 after the sharedpkg/tests/issues/isolatedsuite reportedTestAutoIDCacheRestartAndDisabledNodeand package-level failure; it published diagnostic artifacts10486052461and10486240757. The downstream Coverage job then reportedprerequisites_ready=falseand did not calculate a coverage verdict. This is a producer test-run failure, not a changed-code coverage threshold verdict. The regular Ubuntu UT job also failed in unrelatedpkg/vm/engine/tae/db/test/Test_CheckpointChaos2with a checkpoint context deadline and expected/actual list mismatch; none of the PR-touched FULLTEXT2 files are involved.5bf6d24157959febb839615462c30eafb5046fc9is required; the pre-rebase run is retained as diagnostic evidence only.