|
|
|
|
|
by omazurov
1735 days ago
|
|
Increasing the size of the array 10x (100_000_000) and filling a glaring omission: Go (go1.17.1 darwin/amd64) took 5.591593544s
took 5.285948722s
took 5.218750076s
took 5.239224787s
took 5.131232207s
Zig (0.9.0-dev.959+f011f1393) took 3.48s
took 3.37s
took 3.44s
took 3.43s
took 3.49s
Java (openjdk version "17-ea") Time: 2684 ms
Time: 2654 ms
Time: 2840 ms
Time: 2676 ms
Time: 2649 ms
MacBook Pro Early 2013, 2.7 GHz Quad-Core Intel Core i7, 16 GB 1600 MHz DDR3 |
|
I think .NET 6 latest preview would slightly beat out Java here as well.
This isn't exactly apples-to-apples since Zig/Rust/Go are considered "systems languages", but the JVM has GraalVM for compiling to native binaries/libraries and even importing/exporting C functions and structs. And .NET of course has .NET Native + "Dotnet Native Exports", including the LLVM experiment where it uses LLVM bitcode instead of Ryu.
So you can make the argument that writing a native binary or a library which exported this benchmark function as a C-callable method with a C header in each language would technically equivalent.
The JVM and .NET ones would have a large size (several MB each) but would otherwise still fill this requirement.