Expand list of targets more efficiently
dcf has been using a tool called NYTProf to profile rbm: https://people.torproject.org/~dcf/graphs/nytprof-rbm-20200212-94fce31e/#subs_table
According to this, rbm has been spending a lot of time in the RBM::get_target
function.
When the rbm configuration contains something like this:
targets:
torbrowser-linux-x86_64:
- linux-x86_64
- linux
And the list of current targets is [ 'torbrowser-linux-x86_64' ]
, the RBM::get_targets
function (which is calling RBM::get_target
) is responsible for expanding the list of current targets to [ 'linux-x86_64', 'linux' ]
. It is probably possible to re-implement this in a more efficient way.