mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
PPC: Introduce an alias cache for faster lookups
When running QEMU with "-cpu ?" we walk through every alias for every target CPU we know about. This takes several seconds on my very fast host system. Let's introduce a class object cache in the alias table. Using that we don't have to go through the tedious work of finding our target class. Instead, we can just go directly from the alias name to the target class pointer. This patch brings -cpu "?" to reasonable times again. Before: real 0m4.716s After: real 0m0.025s Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
b177d8b77c
commit
9761ad7571
3 changed files with 30 additions and 7 deletions
|
@ -31,9 +31,10 @@
|
|||
typedef struct PowerPCCPUAlias {
|
||||
const char *alias;
|
||||
const char *model;
|
||||
ObjectClass *oc;
|
||||
} PowerPCCPUAlias;
|
||||
|
||||
extern const PowerPCCPUAlias ppc_cpu_aliases[];
|
||||
extern PowerPCCPUAlias ppc_cpu_aliases[];
|
||||
|
||||
/*****************************************************************************/
|
||||
/* PVR definitions for most known PowerPC */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue