Better serialization of binary values and singletons #844
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Instead of sending single values as
VecRingT
, we serialize them as individual elements. This is especially beneficial when doing bitwise comparisons, where sending a single bit required 5 bytes of serialized data. This change reduces it to 2. For u64, the size is reduced from 20 to 10 bytes.In addition, this PR replaces
bincode
withbitcode
, which is about 15% more compact for theNetworkValue
enum. The total gain is about 37%.Communication cost per party to insert 1 vector into a database of size 1 (i.e., one call to
eval_distance
and one call toless_than
) is given below.Before:
After:
bitcode
is slower thanbincode
, which is reflected in a 5-25% increase in running time for both insertion and search.