Naive performance comparison of a few programming languages (JavaScript, Kotlin, Rust, Swift, Nim, Python, Go, Haskell, D, C++, Java, C#, Object Pascal, Ada, Lua, Ruby)
The programs don't do much work so about 15% of the Java time is just startup costs that disappear (become amortised) if the program is run longer. So performing 10 times the work and dividing the time by 10 gives a magical performance boost: ``` class Main { public static void program_main(String[] args) { Tree tree = new Tree(); int cur = 5; int res = 0; for (int i = 1; i < 1000000; i++) { int a = i % 3; cur = (cur * 57 + 43) % 10007; if (a == 0) { tree.insert(cur); } else if (a == 1) { tree.erase(cur); } else if (a == 2) { boolean hasVal = tree.hasValue(cur); if (hasVal) res++; } } System.out.println(res); } public static void main(String[] args){ for (int i=0; i<10; ++i){ Main.program_main(args); } } } ```
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by igouy and has received 5 comments.