Spawning julia
is slow, so spawning Julia to do a single small arithmetic calculation will be inefficient. If that’s how you want to use Julia, you are better off with bc
.
That’s not how other people typically use, Julia, however—or, for that matter, how they use most other programming languages, including Python. They spawn Julia (or whatever program) once and then do lots of calculations. For this pattern, tools like @btime
and timeit
are more useful and revealing, because they measure the marginal cost of a single small operation.