Adding 11 dominant metrics slowed up metric.values() considerably. Try to speed up.
Activity
leppott commentedon Mar 19, 2018
Seemed mostly ok until had to define pipe, %>%. That is when it slowed down but otherwise got an error if dplyr wasn't loaded.
line 270 in metric.values.R
define pipe
%>%<- dplyr::%>%Should clean up the extra data frames that were created for the dominant metrics. This may free up some memory and keep things from getting sluggish.
leppott commentedon Mar 19, 2018
Only minor improvement with removing extra data frames.
Defining pipe seems to be the issue.
v1.0.0.9001
leppott commentedon Mar 19, 2018
Nothing else to do at this point other than to disable the metrics if don't need.
I could add a trigger in the calling routine to set the max number of Dominant metrics to generate.
Then I could modify the code to loop through until have all of those metrics added.
This might be a good idea even if not putting into master function call.
leppott commentedon Jul 3, 2019
Time metric.values:
leppott commentedon Jul 23, 2020
Better but still a bit slow.
This is example number 2 in metric.values().
678 samples.
leppott commentedon Dec 12, 2022
Ran a 19 MB, 125k records (2000+ samples) file and it took somewhere between 45 min and 1 hour.
Have added lots of metrics so may have to break apart and then merge back together.
leppott commentedon Dec 23, 2022
Things to try:
group_byfirst or inside ofsummarise(current configuration).Switch packages (requiring a rewrite) from
dplyr::summarisetodata.table.Check if can add conditions to the data then evaluate them more easily in the summarise.
https://community.rstudio.com/t/dplyr-summarise-with-condition/100885/3