Here are the comparisons using rbenchmark
:
> benchmark(x=rexp(1e6,rate=101.01))
elapsed user.self sys.self
4.617 4.564 0.056
> benchmark(x=-log(runif(1e6))/101.01)
elapsed user.self sys.self
14.749 14.571 0.184
> benchmark(x=rgamma(1e6,shape=1,rate=101.01))
elapsed user.self sys.self
14.421 14.362 0.063
> benchmark(x=rexp(1e6,rate=.01))
elapsed user.self sys.self
9.414 9.281 0.136
> benchmark(x=-log(runif(1e6))/.01)
elapsed user.self sys.self
7.953 7.866 0.092
> benchmark(x=rgamma(1e6,shape=1,rate=.01))
elapsed user.self sys.self
26.69 26.649 0.056
So mileage still varies, depending on the scale!