It seems like there’s overhead running Julia scripts that seem unreasonable and maybe I’m doing something wrong or missing a step.
For example, I ran the nbody benchmark on my machine and gave it a few numbers. nbody basically does a bunch of math and nothing else (no plotting or graphics). It just prints 3 numbers at the end. Here are the results (higher numbers mean more iterations/complexity):
nbody 5000000 took 0.52 seconds which is amazing!
nbody 50000 took 0.31
nbody 5 took 0.29
nbody 1 took 0.28
So whether doing a 50k object simulation or only doing 1 takes about the same time which means there’s some overhead in running a script. Why is there overhead? Is julia loading a bunch of packages when we call scripts? Is there any other way to reduce the overhead?
I’m running the script in a command prompt in windows 10.
EDIT: The culprit in this case was @printf. Why the heck is print so slow?!