Closed larmarange closed 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).
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).
cf. https://github.com/ddsjoberg/gtsummary/issues/1385