Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #36 +/- ##
==========================================
+ Coverage 63.03% 64.74% +1.71%
==========================================
Files 41 41
Lines 2221 2221
==========================================
+ Hits 1400 1438 +38
+ Misses 645 622 -23
+ Partials 176 161 -15
... and 1 file with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
This reverts commit ffbce94.
Pull request was converted to draft
wirebson/raw_document.go
Outdated
There was a problem hiding this comment.
That part is very unfortunate. The whole idea was to avoid making extra copies – and here, we have to make an extra copy to satisfy the interface. Maybe we should drop AnyDocument/AnyArray altogether?..
On hold for now
There was a problem hiding this comment.
I also wasn't satisfied with this solution, but it seems to be the only solution with our current AnyDocument contract.
If we want to stay with Any(Document/Array) we might consider passing pointer to RawDocument as an argument instead.
On the other hand the improvements from Encode of non-raw objects affect benchmark results significantly, so we could merge this one and create another issue to improve raw objects. What do you think?
EDIT: If I think about it know I'm not sure if we even have (RawDocument).Encode() benchmarks
There was a problem hiding this comment.
The benchmark results are a bit misleading: the speedup comes (as expected!) from the fact that we re-use the memory. But to benefit from it, we need to actually reuse the memory in FerretDB, and we haven't done that yet.
Let's release the first version of FerretDB v2 first, and then try again with this PR.
|
@noisersup this pull request has merge conflicts. |
|
@noisersup this pull request has merge conflicts. |
chilagrow
left a comment
There was a problem hiding this comment.
Is this PR still needed?
# Conflicts: # Taskfile.yml # wirebson/size.go
There was a problem hiding this comment.
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Files not reviewed (1)
- wirebson/objectid.go: Evaluated as low risk
Comments suppressed due to low confidence (2)
wirebson/array.go:172
- [nitpick] The panic message for the length check could be more descriptive to specify which field caused the issue.
raw[s-1] = 0
wirebson/encode.go:86
- The parameter 'name' should not be passed to encodeScalarField. It should be 'return i + encodeScalarField(b[i:], v), nil'.
return i + encodeScalarField(b[i:], name, v), nil
|
@noisersup this pull request has merge conflicts. |
Closes #21.
Encoding benchmarks sped up by around 85-90%. The geomean is affected by much smaller improvements in logging benchmarks.