CommencerCommencer gratuitement

Relative time

When benchmarking it's important to consider both absolute and relative times. Using the timings below, on average a single call to read.csv() is 720 - 80 = 640 milliseconds slower than that of readRDS().

> microbenchmark(read.csv("movies.csv"),
                 readRDS("movies.rds"),
                 times = 10)

Unit: milliseconds
                       expr  min  lq  mean  median   uq neval cld
read.csv("movies.csv")  540  660 680   720     720  740    10   b
 readRDS("movies.rds")   70   80  90    80     100  110    10  a 

Approximately, how much slower is the mean time of read.csv() compared to readRDS()?

Cet exercice fait partie du cours

Writing Efficient R Code

Afficher le cours

Exercice interactif pratique

Passez de la théorie à la pratique avec l’un de nos exercices interactifs

Commencer l’exercice