Closed knokknok closed 3 months ago
The code for dep_auto in cache.R is O(n^2).
dep_auto
cache.R
Wouldn't it be possible to only process the globals of the current chunk (i <- "id of current chunk") instead of looping over all the chunks?.
i <- "id of current chunk"
For a document with many chunks, there is a lot of time spent in dep_auto because of the two nested loops.
Thanks for your thoughts!
O(n^2) does sound bad. Do you want to send a PR to simplify it? Sorry I've been quite busy recently.
The code for
dep_auto
incache.R
is O(n^2).Wouldn't it be possible to only process the globals of the current chunk (
i <- "id of current chunk"
) instead of looping over all the chunks?.For a document with many chunks, there is a lot of time spent in
dep_auto
because of the two nested loops.Thanks for your thoughts!