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?!
I’m looking to use it in real-time applications. Gaming related so performance and low-latency is important. Julia scripts would be run embedded in a C++ application.
The Revise package did help a lot. A big chunk of the problem with performance is simply using @printf which is strange to me.
The daemon mode is interesting too. Is there a way to do aot compiling or not re-compile if a script hasn’t changed?