vak: (Default)
[personal profile] vak
github.com/bddicken/languages

На настоящий момент сравниваются языки Kotlin, C, Go, Rust, Node, Bun, Deno, PyPy, Java, Ruby, PHP, R, Python, Dart. Жаль нету Swift и Perl.

Два теста:
  • loops
  • fibonacci
Предлагается добавлять новые тесты и языки.

Date: 2024-11-27 22:00 (UTC)
From: [personal profile] sassa_nf
OpenJDK 11
Benchmark           (size)  Mode  Cnt       Score      Error  Units
Fibo.FiboRecursive      40  avgt   25  922753.617 ± 2747.036  us/op

0.9s, basically.


OpenJDK 17
Benchmark           (size)  Mode  Cnt        Score      Error  Units
Fibo.FiboRecursive      40  avgt   25  1032010.482 ± 8309.430  us/op

1s, basically.


OracleJDK 23
Benchmark           (size)  Mode  Cnt        Score      Error  Units
Fibo.FiboRecursive      40  avgt   25  1082715.628 ± 6358.441  us/op


I would expect your numbers to be dominated by JVM startup. Are you on SSD?

At the same time, fibonacci using GCC is 0.38s, and using clang is 0.56s, so it's not just a slow computer.
Edited Date: 2024-11-27 22:02 (UTC)

Date: 2024-11-28 09:50 (UTC)
From: [personal profile] sassa_nf
Actually, no, the effect is coming from other parameters of the system, not startup specifically.