Re:Nim 1.0
by neverartful on Tuesday September 24, 2019 @02:10AM
(#21057019)
Replying to my own post to provide better formatting of execution times.
1. C++ 0.04 (gcc version 5.4.0)
2. Rust 0.11 (version 1.37.0)
3. Go 0.13 (version 1.12.7)
4. D 0.16 (tied with Pascal) (DMD64 D Compiler v2.073.2-devel)
5. Pascal 0.16 (tied with D) (fpc 3.0.2)
6. C# 0.25 (mono 4.8.1)
7. Nim 0.50 (1.0.0)
8. Kotlin 0.81 (Kotlin version 1.3.50-release-112, JRE 1.8.0_222)
9. Java 0.95 (openjdk version "1.8.0_131")
10. Scala 1.79 (version 2.12.2, running on 1.8 openjdk)I am pretty sure it should be very close to or the same as C++. Ask around on the Nim forum.
Re:Nim 1.0
by littlestymaar on Tuesday September 24, 2019 @07:47AM
(#21058921)
And the x2 difference between C++ and Rust looks suspicious too.
Obviously, if you measure cold starts, JVM-based languages will be slower...
Re:Nim 1.0
by neverartful on Tuesday September 24, 2019 @02:22AM
(#21057089)
Agreed. I include them in the list as a matter of completeness.
Surprised to see Nim that slow, typically it ranks much higher in benchmarks. But without looking at the code and compiler options its hard to tell if it is simply the problem or the implementation that's to blame.
There are many other benchmarks around where Nim is usually quite close to C. Perhaps Nim was not compiled in release mode.
Re:Nim 1.0
by squarefoot on Tuesday September 24, 2019 @08:53AM
(#21059547)
or possibly was a line-to-line translation of the original test without using any peculiarities of Nim.
Re:Nim 1.0
by nickitolas on Wednesday September 25, 2019 @07:45AM
(#21069763)
I'm very surprised to see rust that slow. Could you share at east parts of your code?
For a side project of mine, I recently re-wrote the same code in a dozen or so languages. The application reads input data from text file and does a bunch of conversions to integers and floats (atoi and atof). It then runs through an algorithm that does calculations and identifies proper actions. Finally, it writes the output data as formatted text file. Regardless of implementation, it runs quick. Sorry I can't provide more details on nature of the code (it has IP that belongs to another person).
Here are the top 10 best execution times (all run on same hardware). Times obtained by 'time' utility (e.g., "time ./run.sh"). Some of these were run on Ubuntu 16.04 and a few were run on FreeBSD 11.2. Where the compiler has optimization flags, I used it.
1. C++ 0.04 (gcc version 5.4.0) 2. Rust 0.11 (version 1.37.0) 3. Go 0.13 (version 1.12.7) 4. D 0.16 (tied with Pascal) (DMD64 D Compiler v2.073.2-devel) 5. Pascal 0.16 (tied with D) (fpc 3.0.2) 6. C# 0.25 (mono 4.8.1) 7. Nim 0.50 (1.0.0) 8. Kotlin 0.81 (Kotlin version 1.3.50-release-112, JRE 1.8.0_222) 9. Java 0.95 (openjdk version "1.8.0_131") 10. Scala 1.79 (version 2.12.2, running on 1.8 openjdk)