Skip to content

Switch to Postcard#432

Merged
jdm merged 12 commits intoservo:mainfrom
Narfinger:postcard2
Jan 9, 2026
Merged

Switch to Postcard#432
jdm merged 12 commits intoservo:mainfrom
Narfinger:postcard2

Conversation

@Narfinger
Copy link
Copy Markdown
Contributor

Switch to postcard instead of bincode. This needs the error handling pr.

@Narfinger Narfinger force-pushed the postcard2 branch 3 times, most recently from 06b54fa to 636414a Compare January 5, 2026 10:25
@Narfinger Narfinger marked this pull request as ready for review January 5, 2026 10:26
@Narfinger Narfinger mentioned this pull request Jan 5, 2026
@sagudev
Copy link
Copy Markdown
Member

sagudev commented Jan 5, 2026

This needs companion PR in servo so we can test performance implications.

@Narfinger
Copy link
Copy Markdown
Contributor Author

I have a test branch https://github.com/Narfinger/servo/tree/postcard-switch. I am not sure which ways are best testcases but speedometer seems either the same or slightly faster on the two tests runs I did. Anything else that would be good for testing?
If you do any testing, notice that the -M flag is important because of the GenericChannel switch.

@glyn
Copy link
Copy Markdown
Contributor

glyn commented Jan 5, 2026

Switch to postcard instead of bincode. This needs the error handling pr.

I would appreciate an explanation of the rationale for this change. (The reason I ask is that I am developing a multiplexing crate (ipc-channel-mux) on top of ipc-channel and may wish to use the same dependency if there are significant advantages.)

@Narfinger
Copy link
Copy Markdown
Contributor Author

Narfinger commented Jan 5, 2026

Some of the rational was discussed here: https://servo.zulipchat.com/#narrow/channel/263398-general/topic/Ipc-Channel.20Switch.20to.20rkyv/with/564657184. Sorry, I thought I linked this above but I missed it. Additionally, the error handling might change. At the moment ipc-channel exports the bincode error which seems a bit suboptimal.

In short, bincode1 maintainer had a big blowup and the future is a bit uncertain. (See also here: https://docs.rs/crate/bincode/latest). Additionally, postcard seems to be faster than rkyv and bincode.

@glyn
Copy link
Copy Markdown
Contributor

glyn commented Jan 5, 2026

@Narfinger Makes sense, thank you. I'll probably align ipc-channel-mux in due course, although PRs would also be welcome. ;-)

@Narfinger
Copy link
Copy Markdown
Contributor Author

With this https://rustsec.org/advisories/RUSTSEC-2025-0141.html perhaps we should get this and the error PR merged? @sagudev

Copy link
Copy Markdown
Contributor

@glyn glyn left a comment

Choose a reason for hiding this comment

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

Some minor comments. Also, does this PR need rebasing on main to remove the error unification changes which just landed?

Comment thread src/platform/macos/mod.rs Outdated
Comment thread src/ipc.rs
types.

These types will give the Bincode error, Io errors (which are converted
from platform errors) and Disconnect.
Additionally we now use the thiserror crate which removes some of the
code.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
types.

These types will give the Bincode error, Io errors (which are converted
from platform errors) and Disconnect.
Additionally we now use the thiserror crate which removes some of the
code.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@glyn glyn left a comment

Choose a reason for hiding this comment

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

LGTM thanks.

@jdm jdm added this pull request to the merge queue Jan 9, 2026
Merged via the queue into servo:main with commit 70b0a3b Jan 9, 2026
25 checks passed
@Narfinger Narfinger deleted the postcard2 branch January 12, 2026 08:20
glyn added a commit to glyn/ipc-channel-mux that referenced this pull request Feb 5, 2026
Since ipc-channel switched, do the same here.

Rationale for ipc-channel switching:

servo/ipc-channel#432 (comment)

See also:

servo/ipc-channel#440
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