profiling(HFWutils)R Documentation

plots tree of execution times

Description

determines how much time a function its and sub-functions (and sub-functions thereof etc) take to run (‘profiling’). Also draws picture of this using the interrelations of functions.

Usage

profiling(      s = NULL, 
                myFunction, 
                myEnvirons, 
                ... , 
                topQuantile = 0.25)

Arguments

s is optional; would be the result returned by a previous profiling run
myFunction myFunction is the function to be profiled
myEnvirons is a function defining which functions should be included in the analysis
... are additional arguments that will in turn be passed to the ‘foodweb’ function
topQuantile specify the limit for the display of the top time consumers, by quantile

Author(s)

Felix Wittmann hfwittmann@gmail.com

Examples

   #############################################################################
  
    y <- 0

    testFunction1 <- function(X) 
                        { 
                          for (x in 1:X) {y <- y + x} 
                          return(y)
                        } # function
    testFunction2 <- function(X)  testFunction1(X)
    testFunction3 <- function(X)  testFunction1(X) 
    testFunction4 <- function() {
                                  testFunction2(1000000)
                                  testFunction3(1000000)
                                } # testFunction4 
    
  ##############################################################################
      namespacePackage <- function() find.funs("package:base")
      workspace <- function() find.funs(pos=1)

   s1<-profiling(myFunction=testFunction4,myEnvirons=workspace)


[Package HFWutils version 0.7.2007.09.02 Index]