New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out why gather() is so much slower than melt() #18

Closed
hadley opened this Issue Aug 12, 2014 · 1 comment

Comments

Projects
None yet
1 participant
@hadley
Member

hadley commented Aug 12, 2014

@hadley

This comment has been minimized.

Member

hadley commented Aug 22, 2014

Looks like it's the non-standard eval:

library(microbenchmark)
iris1 <- iris[sample(1:nrow(iris), 1e4, replace = T), ] 

microbenchmark(
  melt = reshape2::melt(iris1,id.vars="Species"), 
  gather = tidyr::gather(iris1, variable, value, -Species),
  gather_ = tidyr::gather_(iris1, quote(variable), quote(value), c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width"))
)
Unit: milliseconds
    expr  min   lq median   uq   max neval
    melt 2.41 2.66   3.15 4.87 52.49   100
  gather 3.97 4.98   6.40 6.82  8.41   100
 gather_ 2.43 2.67   3.07 4.94 51.42   100

@hadley hadley closed this in eb5fff7 Aug 22, 2014

@dichika dichika referenced this issue Sep 14, 2015

Open

Rlibrary #15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment