mlr-org / paradox

ParamHelpers Next Generation
https://paradox.mlr-org.com
GNU Lesser General Public License v3.0
28 stars 7 forks source link

adding params_unid #333

Closed mb706 closed 3 years ago

mb706 commented 3 years ago

Performance improvement for miesmuschel, mlr3pipelines and possibly others.

Whenever the $params active binding is called, ParamSetCollection (PSC) creates a clone of every Param that it contains. This is only done because the Param's $id, when returned from a PSC, is different from when returned from its sub-ParamSets. However, the $id slot is hardly ever used, so we can avoid a lot of cloning if there is a "$params-but-without-the-id" active binding that can be used instead. This active binding would just return the uncloned Params.

Since $params gets accessed quite a lot this can make quite some difference, more than a factor of 2 for miesmuschel in some cases.

I plan to add some documentation about how params_unid is for internal use mostly. Would be happy about other comments.