Skip to content

metric.values - speed up #2

Open

Description

@leppott

Adding 11 dominant metrics slowed up metric.values() considerably. Try to speed up.

Activity

  1. leppott commented on Mar 19, 2018

    @leppott
    OwnerAuthor

    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.

  2. leppott commented on Mar 19, 2018

    @leppott
    OwnerAuthor

    Only minor improvement with removing extra data frames.

    Defining pipe seems to be the issue.

  3. added a commit that references this issue on Mar 19, 2018
  4. leppott commented on Mar 19, 2018

    @leppott
    OwnerAuthor

    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.

  5. transferred this issue fromleppott/BCGcalcon Nov 19, 2018
  6. leppott commented on Jul 3, 2019

    @leppott
    OwnerAuthor

    Time metric.values:

    image

  7. leppott commented on Jul 23, 2020

    @leppott
    OwnerAuthor

    Better but still a bit slow.

    This is example number 2 in metric.values().
    678 samples.

    image

    image

  8. leppott commented on Dec 12, 2022

    @leppott
    OwnerAuthor

    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.

  9. leppott commented on Dec 23, 2022

    @leppott
    OwnerAuthor

    Things to try:

    1. group_by first or inside of summarise (current configuration).

    image

    1. Switch packages (requiring a rewrite) from dplyr::summarise to data.table.

    2. 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

    image

  10. pinned this issue on May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions