qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1 2/8] cpu: cache CPUClass in CPUState for hot code paths


From: Richard Henderson
Subject: Re: [PATCH v1 2/8] cpu: cache CPUClass in CPUState for hot code paths
Date: Thu, 11 Aug 2022 10:17:36 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

On 8/11/22 08:14, Alex Bennée wrote:
The class cast checkers are quite expensive and always on (unlike the
dynamic case who's checks are gated by CONFIG_QOM_CAST_DEBUG). To
avoid the overhead of repeatedly checking something which should never
change we cache the CPUClass reference for use in the hot code paths.

Signed-off-by: Alex Bennée<alex.bennee@linaro.org>
---
  include/hw/core/cpu.h | 9 +++++++++
  cpu.c                 | 9 ++++-----
  2 files changed, 13 insertions(+), 5 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]