On 2/4/26 1:10 AM, Daniel P. Berrangé wrote:
On Tue, Feb 03, 2026 at 11:41:13AM -0800, Pierrick Bouvier wrote:
target_arch() function will reparse target_name() every time if it was
not set to a proper SYS_EMU_TARGET_* value (when using
target-info-stub.c), which is not efficient.

Since we want to preserve the constness of TargetInfo but C doesn't give
us flexible compile time expressions, we simply set target_arch using a
static constructor once instead.

This was found when doing changes to virtio_access_is_big_endian()
function, having an overhead of 50% after switching to runtime checks.
With this, overhead left is around 3%, due to indirect function
calls.

Hmm, this presumably needs to be backported to 10.1.0 / 10.2.0
stable branches, given that performance hit.


Indeed, I'll let Richard fix it.


With regards,
Daniel

Regards,
Pierrick

Reply via email to