mastodon.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
The original server operated by the Mastodon gGmbH non-profit

Administered by:

Server stats:

380K
active users

recently, I have been having some discussions with @pid_eins about D-Bus vs. Varlink. He made a point that the efficiency of the encoding isn't in the end, as important as the effects of context switching, given that the modern chips are super efficient at parsing and copying data, but not really good at context switching.

I knew that there is a lot of truth to that but I wanted to find out how much so I did some benchmarking:

github.com/zeenix/json-vs-bin

Turns out, he's absolutely right on money.

P.S. No, don't worry. This doesn't mean I'll abandon my D-Bus work/plans. D-Bus is not going anywhere anytime soon and the world still needs easy and safe implementations of it.

GitHubGitHub - zeenix/json-vs-bin: Benchmarking JSON vs. binary formatsBenchmarking JSON vs. binary formats. Contribute to zeenix/json-vs-bin development by creating an account on GitHub.

@zeenix @pid_eins I've not seen varlink before. Looks like it doesn't support passing file descriptors? Which many DBus interferences need.

DBus, Wayland, Pipewire and the like all implement different systems for typed messages over Unix sockets that can contain file descriptors. It would be nice if there was one standard for that, with an IDL, and possibly a better kernel API (microkernel APIs like `mach_msg` are worth comparing).

But we're kind of stuck supporting what exists.

Lennart Poettering

@ids1024 @zeenix

systemd has been using Varlink for various things internally a lot, and now started to expose APIs to outside via Varlink too.

And we pass around fds via it a lot. It's not part of the Varlink protocol itself so much though. It's more a part of the transport.

@pid_eins @ids1024 mind you that in D-Bus, the FDs aren't passed as payload either and rather through a socket option. D-Bus just provides a type to send over the integer indices of the FDs vector sent through an out-of-band method (currently only possibly through the socket option AFAIK) to make things easier.