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: Philippe Mathieu-Daudé
Subject: Re: [PATCH v1 2/8] cpu: cache CPUClass in CPUState for hot code paths
Date: Fri, 12 Aug 2022 01:37:15 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.12.0

On 11/8/22 17: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: Philippe Mathieu-Daudé <f4bug@amsat.org>




reply via email to

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