On 2/5/26 8:50 AM, Dominik Csapak wrote:
On 2/4/26 4:45 PM, Thomas Lamprecht wrote:
Am 04.02.26 um 11:04 schrieb Dominik Csapak:
[snip]
+initialize_cpu_models();
this now still always does this on module load, would be nicer to
actually
only pay for that if needed by adding getter methods for each
variable, like
sub get_all_cpu_models {
initialize_cpu_models() if !defined($all_cpu_models);
return $all_cpu_models;
}
Same with a get_cpu_models_by_arch getter.
not sure if that gains us anything, since we need the 'all_cpu_models'
hash statically for the 'reported-model' enum of $cpu_fmt, so even if i
put it in a getter, it would still get initialized on module load...
also not sure if having two seperate getters make sense, since
the 'all_cpu_models' one depends on the cpu_models_by_arch one.
So in that case we'd have to initialize both anyway (again, on module
load).
so this would make code a bit more complicated, but I don't really see
the gain here.
just to avoid confusion here, of course i'm still open to doing the
getters for this (maybe there is another argument i can't think of right
now), just let me know how you want me to continue
And I'd split this and the host_arch change into separate patches,
they are rather
unrelated to each other.
yes, this make sense of course