The Computer Language
24.11 Benchmarks Game

startup

(Naive) Let's modify a few n-body programs to perform 3,000 in-process warm-up iterations; and then perform once-more for measurement, recorded by os.path.getmtime('two') - os.path.getmtime('one') side-effects.

Let's reduce the workload 250x from N=50,000,000 to N=200,000, so runtimes are only one or two tenths-of-a-second.

  source process in-process warm-up    
  C gcc #0 0.025 0.024  
  C gcc     0.022
  Java #0 0.151 0.076  
  Java     0.029
  Java #9     7.392
  Java -Xint #0 0.939 0.748  
  Java -Xint     0.748
  Node.js #0 0.133 0.046  
  Node.js     0.038
  Python 3 #0 2.065 2.041  
  Python 3     2.037
  Ruby yjit #0 1.648 1.565  
  Ruby yjit     1.551
  Toit #0 2.133 2.063  
  Toit     2.153

The "process" measurements (the usual elapsed-seconds) were made without doing warm-up iterations and include startup costs.

The "in-process" measurements were made without doing warm-up iterations and exclude startup costs.

The "warm-up" measurements were made after doing 3,000 warm-up iterations and exclude startup costs.

The N=50,000,000 workload used for n-body programs takes seconds and tens-of-seconds. The Java #9 warm measurement is a few tenths-of-a-second faster.