I have two almost identical codes:

```
#!/usr/bin/env julia
using Random
if(length(ARGS)==1)
N=parse(Int64,ARGS[1])
else
N=1000
end
function play()
r=0
counter=0.0
while r<1.0
r+=rand(Float64)
counter+=1
end
return counter
end
function drive()
e=0.0
for i in 1:N
e+=play()
end
println(e/N)
end
@time drive()
```

with `15.485858 seconds (300.53 M allocations: 5.985 GiB, 0.59% gc time)`

and

```
#!/usr/bin/env julia
using Random
function play()
r=0.0
counter=0.0
while r<1.0
r+=rand(Float64)
counter+=1.0
end
return counter
end
function drive(N::Int64)
e=0.0
for i in 1:N
e+=play()
end
println(e/N)
end
@time drive(length(ARGS)==1 ? parse(Int64,ARGS[1]) : 1000)
```

with `4.922885 seconds (468.38 k allocations: 21.594 MiB)`

Why is the latter a factor three faster â€“ or why does the former use so much memory?

Thanks!