[th/config-match-lookup]
nm_config_data_get_connection_default()
gets called a lot.
Mostly by nm_device_get_route_metric()
.
In an example profiling run activating a 100 devices it thus shows up to consume 13.3% of the CPU time. That's mainly due to the overhead of g_key_file_get_string()
(interestingly, it is due to glib_gettext()
to construct the GError
message). Anyway, it sucks.
Add our own lookup index for these values and use binary search.