Skip to content

Conversation

@dolio
Copy link
Contributor

@dolio dolio commented Oct 6, 2025

This switches from using Put in serialization to directly using Builder. The former is essentially just ((), Builder), and I don't think that will get completely optimized away.

In a microbenchmark, this was a massive difference (around 10x). However, for actual unison values, the difference seems much less significant. It's around 2x better on things like lists of pairs, or maps of numbers. I've been looking for some additional performance gain tweaks, but haven't found any yet.

dolio and others added 2 commits October 6, 2025 13:24
`Put` is just an inefficient wrapper, and directly using `Builder` can make
a big difference when serializing a lot of small things.
@aryairani
Copy link
Contributor

Ah bummer slash cool.

Copy link
Member

@pchiusano pchiusano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am good with merging once CI passes. I think this is a nice improvement even if it's not orders of magnitude better.

@dolio
Copy link
Contributor Author

dolio commented Oct 7, 2025

Finally tracked down the compilation problem. I was serializing just the utf8 strings without their lengths for e.g. version when compiling.

@dolio dolio marked this pull request as ready for review October 8, 2025 15:54
dolio added 2 commits October 8, 2025 12:21
Became unused in the serialization rewrite, but remains potentially useful.
@dolio
Copy link
Contributor Author

dolio commented Oct 8, 2025

All base tests passed before the merge with trunk.

Think this is ready to go.

@pchiusano pchiusano merged commit 3257bad into trunk Oct 8, 2025
32 checks passed
@pchiusano pchiusano deleted the topic/serial-builder branch October 8, 2025 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants