In the vast majority of the cases, a DecryptNotesResponse will contain zero or close-to-zero decrypted notes. It makes sense to have the serialization of DecryptNotesResponse optimize for those cases.
This changes the serialization size of DecryptNotesResponse from O(null_notes + non_null_notes) to O(non_null_notes).
This introduces a small size overhead in the case where the are a lot of decrypted notes. We could in theory have DecryptNotesResponse choose between sparse and dense serialization based on how many decrypted notes there are, but that case is so rare, and the overhead so small, that it's not worth optimizing for it.
Summary
In the vast majority of the cases, a
DecryptNotesResponse
will contain zero or close-to-zero decrypted notes. It makes sense to have the serialization ofDecryptNotesResponse
optimize for those cases.This changes the serialization size of
DecryptNotesResponse
fromO(null_notes + non_null_notes)
toO(non_null_notes)
.This introduces a small size overhead in the case where the are a lot of decrypted notes. We could in theory have
DecryptNotesResponse
choose between sparse and dense serialization based on how many decrypted notes there are, but that case is so rare, and the overhead so small, that it's not worth optimizing for it.Testing Plan
Unit tests
Documentation
N/A
Breaking Change
N/A