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.
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