potential optimization: set message sender in sender, validate in bus daemon
Submitted by Simon McVittie
Assigned to D-Bus Maintainers
Message senders on a connection to a bus daemon should write their own unique name (if set) into their messages, so that the bus daemon just needs to validate that they have done so. This would avoid byteswapping (Bug #38287), potentially a realloc() per message, and potentially realignment (Bug #38288).
For backwards compatibility we'll also need a slow path in dbus-daemon that overwrites the sender field if the sender was lying about it, but we can make that rare by having libdbus and all its reimplementations (GDBus, ndesk-dbus, dbus-java) set the sender by default.
D-Bus 2.0 - if it ever happens - should just reject messages with a falsified or missing sender field.
 i.e. where dbus_bus_set_unique_name() has been called, either by the application or via higher-level bus APIs