mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 19:59:54 -05:00
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Perf ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description - pgbsonelement today copies the bson_value_t buffer always, use the referrence in critical places to avoid copy Before the fix  After the fix  ---- #### AI description (iteration 1) #### PR Classification Code optimization #### PR Summary This pull request introduces optimizations for point reads by avoiding the copying of BSON value buffers. - `include/io/pgbsonelement.h`: Added `pgbsonelementref` struct and `BsonIterToPgbsonElementRef` function. - `src/query/bson_compare.c`: Updated comparisons to use `pgbsonelementref` instead of `pgbsonelement`. - `src/io/pgbsonelement.c`: Implemented `BsonIterToPgbsonElementRef` function. - `src/query/bsonquery_compare.c`: Modified query comparison logic to utilize `pgbsonelementref`. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->