cmaves / async-rustbus

An asynchronous implementation of the DBus protocol based on rustbus
2 stars 1 forks source link

Include async-rustbus in comparison benchmarks? #5

Open KillingSpark opened 3 years ago

KillingSpark commented 3 years ago

I saw that you released a version of this crate on crates.io, so it is in a usable state?

If you want you can make a PR in the comparison repo between the different dbus crates in the rust ecosystem I am maintaining.

cmaves commented 3 years ago

Answering the question raised by you add the end of benchmark PR:

After some investigation, I traced the performance deficit to signature validation. The async-rustbus implementation for marshalling the header doesn't validate the signature, which in its current form is a very expensive operation in the MarshalMixed bench, taking up 40+% percent of the time in the original rustbus benchmark.

This raises the question of whether this validation should be skipped or not? Unlike other fields in the header, the signature is not directly accessed by end users, so if the Signature impls are correct, the signature should rarely be incorrect. These incorrect scenarios include adding too many arguments or too deeply nested of a signature. (Newly added issue #6 raises will track the fix for these two scenarios)

KillingSpark commented 3 years ago

Ah I see! I think I'll keep this in rustbus, I think it is somewhat important to only send out correct messages to be a "polite" bus participant. But you are right in practice that shouldn't be an issue.

But I think I can still optimize the validation of signatures a lot. I hope that will bring the difference down a bit.