News for hackers. Stuff that matters.
Re:Varlink – IPC to replace D-Bus gradually in systemd by jsnell on Sunday September 29, 2024 @02:14PM (#41689219)
I've done similar things in the past (json over udp-to-localhost, with a schema description used to generate the code for both parsing and generating on each end). It's a totally reasonable point in the design space, and I literally never saw a reason to revisit the decision to use json for that system.

You'd do that because everything under the sun knows how to generate and parse json. Performance looks like a total non-issue for this use case. The messages are tiny, local and infrequent. You wouldn't want to do this on some kind of a high performance application on the data plane, but on the control plane it's totally fine.

Even if you expect that all production use cases will use some kind of higher level library that does schema validation, it can still be quite nice during debugging to a) be able to inspect the messages on the wire when debugging, b) to be able to hand-write and inject messages.

Re:Varlink – IPC to replace D-Bus gradually in systemd by ptx on Sunday September 29, 2024 @05:35PM (#41690876)
> Performance looks like a total non-issue for this use case.

The presentation brings up performance as one of the problems with the D-Bus though, so it seems like it is an issue.

Re:Varlink – IPC to replace D-Bus gradually in systemd by dinosaurdynasty on Sunday September 29, 2024 @06:24PM (#41691320)
The performance problem with D-Bus is the increased number of context switches over Varlink, not serialization.
Re:Varlink – IPC to replace D-Bus gradually in systemd by jsnell on Sunday September 29, 2024 @05:45PM (#41690974)
Fair. What I meant is that the performance delta between JSON and any other interchange data format should be a non-issue in this context. I would be quite surprised to hear that any performance problems systemd has with D-Bus was with serialization/de-serialization.
Re:Varlink – IPC to replace D-Bus gradually in systemd by IshKebab on Sunday September 29, 2024 @05:53PM (#41691044)
Yeah... it's easy to say JSON won't be an issue. It's difficult to switch from JSON when it turns out you were wrong.

https://raphlinus.github.io/xi/2020/06/27/xi-retrospective.h...

Given how central this is going to be why would you skip the tiny bit of extra work needed to use a binary format?

Re:Varlink – IPC to replace D-Bus gradually in systemd by dathinab on Monday September 30, 2024 @03:46AM (#41694580)
> performance delta between JSON and any other interchange data format should be a non-issue

it's hard to say, for most D-Bus taks perf. is an absolute non issues, but still you have bus-1 and all kind of tries to make D-Bus perform faster, reason is there are edge cases where it matters

and even if the marshaling speed might not matter the size can, like if something goes really wrong and tens of thousand of system events get spammed the difference between the memory usage of in-flight messages of a compact format vs. json can make the difference between memory pressure effectively killing your server and you recovering reliable

though what is an open question is how relevant that is in pracive

and that is quite hard to say without inside information for companies running systems where such a thing could happen on a scale where such a thing does happen (e.g. google)

Re:Varlink – IPC to replace D-Bus gradually in systemd by quotemstr on Sunday September 29, 2024 @11:23PM (#41693240)
The problem isn't JSON per se. Parsing JSON is fast. The problem is the simplistic interaction and data model that's just going to move complexity from universal IPC layers to ad hoc application logic that every person has to learn individually. Terrible.