larmarange / broom.helpers

A set of functions to facilitate manipulation of tibbles produced by broom
https://larmarange.github.io/broom.helpers/
GNU General Public License v3.0
22 stars 7 forks source link

Explore how to improve time execution #193

Closed larmarange closed 1 year ago

larmarange commented 1 year ago

cf. https://github.com/ddsjoberg/gtsummary/issues/1385

larmarange commented 1 year ago

It seems that the model matrix is computed several times. Could we think of a way to cache the model matrix? idem for the model frame (for glm it is quick because the model frame is saved within the model, but it is not always the case or it could be different for other type of models).

larmarange commented 1 year ago

I have explored a little. Some improvements could be obtained by caching model matrix and model frame (but requires more memory) and by replace %>% by |>. However it is limited (gaining 1 or 2 sec for a big model).