From 10d5e4c15113fcd01c3f9ea1ce95bea84c8c479f Mon Sep 17 00:00:00 2001 From: Alexander Slesarev Date: Tue, 21 Jul 2020 20:56:14 -0600 Subject: [PATCH] Maintenance update (#261) * Re-run bf mandel tests (addressing #258). * Preparation for Perl 7. * Lua module conflicts have been resolved. --- .rubocop.yml | 30 +++ Makefile | 8 +- README.md | 471 ++++++++++++++++++------------------ base64/base64.rs/Cargo.lock | 6 +- base64/base64.rs/Cargo.toml | 2 +- base64/test-xs.pl | 8 +- base64/test.pl | 8 +- base64/test.v | 8 +- brainfuck/Makefile | 14 +- brainfuck/bf.pl | 43 +--- brainfuck/bf.v | 10 +- common/commands.mk | 7 +- docker/Dockerfile | 75 +++--- json/json.rs/Cargo.lock | 70 +++--- json/json.rs/Cargo.toml | 6 +- json/test-xs.pl | 11 +- json/test.pl | 11 +- json/test.v | 8 +- matmul/matmul.pl | 17 +- matmul/matmul.v | 8 +- 20 files changed, 425 insertions(+), 396 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index a2d9990e..ea175b37 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -57,3 +57,33 @@ Style/RedundantRegexpCharacterClass: Style/RedundantRegexpEscape: Enabled: true + +Lint/DuplicateElsifCondition: + Enabled: true + +Style/AccessorGrouping: + Enabled: true + +Style/ArrayCoercion: + Enabled: true + +Style/BisectedAttrAccessor: + Enabled: true + +Style/CaseLikeIf: + Enabled: true + +Style/HashAsLastArrayItem: + Enabled: true + +Style/HashLikeCase: + Enabled: true + +Style/RedundantAssignment: + Enabled: true + +Style/RedundantFetchBlock: + Enabled: true + +Style/RedundantFileExtensionInRequire: + Enabled: true diff --git a/Makefile b/Makefile index 0e7ab017..5ebc228c 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,12 @@ +docker_build = docker build docker/ -t benchmarks + .PHONY: build build: - docker build docker/ -t benchmarks + $(docker_build) + +.PHONY: rebuild +rebuild: + $(docker_build) --no-cache docker_run = docker run -it --rm -v $(shell pwd):/src benchmarks diff --git a/README.md b/README.md index 8023a797..1681130a 100644 --- a/README.md +++ b/README.md @@ -48,51 +48,51 @@ Testing brainfuck implementations using two code samples (bench.b and mandel.b). ### bench.b -| Language | Time, s | Memory, MiB | Energy, J | -| :----------------- | -------------: | -------------: | ----------------: | -| C++ | 1.00 ± 00.03 | 1.69 ± 00.04 | 19.22 ± 01.46 | -| Nim GCC | 1.72 ± 00.06 | 1.87 ± 00.06 | 34.07 ± 02.61 | -| Vala GCC | 1.73 ± 00.07 | 3.94 ± 00.04 | 35.68 ± 03.03 | -| OCaml | 1.76 ± 00.06 | 5.18 ± 00.06 | 32.24 ± 03.27 | -| C GCC | 1.83 ± 00.11 | 0.73 ± 00.04 | 36.78 ± 03.23 | -| Nim Clang | 1.83 ± 00.07 | 2.31 ± 00.04 | 37.68 ± 03.10 | -| LDC | 1.85 ± 00.08 | 2.95 ± 00.06 | 36.42 ± 03.70 | -| Kotlin | 1.87 ± 00.07 | 40.24 ± 00.15 | 36.47 ± 03.10 | -| GDC | 1.94 ± 00.08 | 6.28 ± 00.07 | 40.83 ± 03.42 | -| Rust | 2.00 ± 00.11 | 2.07 ± 00.07 | 38.56 ± 04.36 | -| Vala Clang | 2.01 ± 00.12 | 5.05 ± 00.08 | 40.84 ± 06.24 | -| C Clang | 2.18 ± 00.09 | 0.71 ± 00.03 | 44.52 ± 04.64 | -| Java | 2.36 ± 00.11 | 38.68 ± 00.14 | 49.51 ± 05.18 | -| C# .NET Core | 2.38 ± 00.12 | 34.84 ± 00.08 | 46.57 ± 05.09 | -| Go | 2.43 ± 00.11 | 3.32 ± 00.42 | 50.51 ± 05.07 | -| V GCC | 2.44 ± 00.10 | 0.71 ± 00.03 | 50.82 ± 04.51 | -| GCC Go | 2.48 ± 00.40 | 23.04 ± 05.31 | 49.57 ± 09.93 | -| MLton | 2.50 ± 00.12 | 0.76 ± 00.04 | 49.09 ± 05.08 | -| Crystal | 2.52 ± 00.11 | 3.33 ± 00.06 | 53.57 ± 04.84 | -| F# .NET Core | 2.75 ± 00.07 | 124.84 ± 01.17 | 52.06 ± 04.13 | -| V Clang | 2.76 ± 00.17 | 1.09 ± 00.03 | 58.67 ± 05.05 | -| Chez Scheme | 2.80 ± 00.14 | 29.15 ± 00.56 | 58.14 ± 05.87 | -| Julia | 3.29 ± 00.15 | 177.16 ± 01.02 | 62.03 ± 05.23 | -| DMD | 3.69 ± 00.12 | 3.50 ± 00.05 | 66.54 ± 05.72 | -| Scala | 3.86 ± 00.26 | 134.95 ± 15.94 | 85.68 ± 05.80 | -| C# Mono | 4.51 ± 00.23 | 20.46 ± 00.11 | 86.97 ± 10.92 | -| Haskell MArray | 4.56 ± 00.21 | 5.30 ± 00.07 | 94.47 ± 10.06 | -| Node.js | 4.56 ± 00.23 | 34.07 ± 00.18 | 85.45 ± 09.44 | -| LuaJIT | 7.33 ± 00.37 | 2.96 ± 00.08 | 136.93 ± 14.32 | -| Racket | 7.77 ± 00.33 | 106.49 ± 00.11 | 151.48 ± 14.52 | -| PyPy | 12.66 ± 00.52 | 108.36 ± 00.13 | 298.10 ± 26.78 | -| Haskell | 16.04 ± 00.73 | 5.38 ± 00.06 | 353.39 ± 34.33 | -| TruffleRuby JVM | 16.06 ± 00.39 | 885.58 ± 57.02 | 476.30 ± 24.99 | -| TruffleRuby Native | 17.39 ± 00.47 | 600.02 ± 12.92 | 400.29 ± 34.52 | -| Ruby JIT | 59.53 ± 02.40 | 14.20 ± 00.05 | 1172.53 ± 106.32 | -| Lua | 73.62 ± 02.59 | 3.09 ± 00.06 | 1440.12 ± 111.21 | -| Ruby | 84.53 ± 03.39 | 13.99 ± 00.04 | 1630.96 ± 141.00 | -| JRuby | 107.47 ± 05.29 | 433.65 ± 04.39 | 2222.46 ± 117.27 | -| Elixir | 115.68 ± 04.51 | 52.89 ± 00.61 | 2417.08 ± 217.93 | -| Python | 231.18 ± 08.55 | 9.88 ± 00.07 | 4823.24 ± 417.40 | -| Tcl (FP) | 266.99 ± 07.42 | 4.29 ± 00.06 | 5618.69 ± 250.76 | -| Perl | 360.18 ± 14.27 | 6.34 ± 00.06 | 7471.42 ± 574.59 | -| Tcl (OO) | 535.51 ± 19.47 | 4.31 ± 00.07 | 11217.49 ± 701.46 | +| Language | Time, s | Memory, MiB | Energy, J | +| :----------------- | -------------: | -------------: | -----------------: | +| C++ | 1.00 ± 00.03 | 1.49 ± 00.02 | 18.64 ± 01.03 | +| OCaml | 1.72 ± 00.12 | 5.07 ± 00.03 | 35.41 ± 05.20 | +| Vala GCC | 1.73 ± 00.08 | 4.01 ± 00.30 | 35.54 ± 03.16 | +| Nim GCC | 1.75 ± 00.10 | 1.87 ± 00.06 | 35.09 ± 03.26 | +| Nim Clang | 1.78 ± 00.05 | 2.34 ± 00.06 | 41.79 ± 01.49 | +| C GCC | 1.81 ± 00.09 | 0.52 ± 00.03 | 35.94 ± 03.60 | +| LDC | 1.86 ± 00.07 | 2.84 ± 00.08 | 35.52 ± 03.22 | +| Kotlin | 1.87 ± 00.08 | 40.32 ± 00.22 | 37.07 ± 03.34 | +| Vala Clang | 1.92 ± 00.08 | 3.94 ± 00.03 | 41.37 ± 04.49 | +| GDC | 1.99 ± 00.09 | 6.27 ± 00.06 | 38.35 ± 03.92 | +| Rust | 2.02 ± 00.07 | 1.94 ± 00.10 | 39.22 ± 03.13 | +| C Clang | 2.16 ± 00.12 | 0.52 ± 00.03 | 44.93 ± 04.01 | +| GCC Go | 2.17 ± 00.11 | 24.58 ± 05.98 | 43.27 ± 04.25 | +| C# .NET Core | 2.38 ± 00.13 | 34.57 ± 00.15 | 48.19 ± 05.44 | +| Java | 2.38 ± 00.15 | 38.72 ± 00.23 | 48.32 ± 04.68 | +| V GCC | 2.42 ± 00.10 | 0.50 ± 00.02 | 51.49 ± 04.92 | +| Go | 2.42 ± 00.13 | 3.09 ± 00.39 | 50.28 ± 05.67 | +| MLton | 2.46 ± 00.12 | 0.55 ± 00.03 | 51.31 ± 05.18 | +| Crystal | 2.58 ± 00.13 | 3.28 ± 00.04 | 53.16 ± 05.03 | +| V Clang | 2.70 ± 00.14 | 0.86 ± 00.02 | 56.23 ± 05.90 | +| F# .NET Core | 2.72 ± 00.06 | 124.28 ± 04.48 | 53.36 ± 03.92 | +| Chez Scheme | 2.80 ± 00.15 | 29.23 ± 00.10 | 59.26 ± 06.64 | +| Julia | 3.33 ± 00.15 | 175.79 ± 00.83 | 59.69 ± 05.34 | +| DMD | 3.53 ± 00.14 | 3.50 ± 00.05 | 72.68 ± 06.50 | +| Scala | 3.91 ± 00.22 | 140.07 ± 04.56 | 80.82 ± 08.19 | +| C# Mono | 4.27 ± 00.21 | 20.09 ± 00.07 | 94.18 ± 08.81 | +| Haskell MArray | 4.70 ± 00.16 | 5.26 ± 00.09 | 89.81 ± 08.47 | +| Node.js | 4.78 ± 00.25 | 33.82 ± 00.18 | 99.72 ± 10.03 | +| LuaJIT | 7.47 ± 00.30 | 2.79 ± 00.10 | 129.95 ± 12.48 | +| Racket | 7.78 ± 00.37 | 106.48 ± 00.10 | 151.95 ± 13.28 | +| PyPy | 13.45 ± 01.41 | 108.40 ± 00.41 | 295.49 ± 38.07 | +| TruffleRuby JVM | 15.89 ± 00.52 | 883.28 ± 58.63 | 486.31 ± 11.03 | +| Haskell | 16.10 ± 00.68 | 5.34 ± 00.08 | 351.80 ± 34.26 | +| TruffleRuby Native | 17.47 ± 00.77 | 598.38 ± 14.73 | 400.83 ± 27.16 | +| Lua | 57.69 ± 02.13 | 2.60 ± 00.04 | 1132.52 ± 96.50 | +| Ruby JIT | 60.77 ± 02.71 | 14.19 ± 00.02 | 1077.52 ± 330.20 | +| Ruby | 83.79 ± 03.32 | 13.94 ± 00.08 | 1671.38 ± 185.56 | +| JRuby | 108.85 ± 03.98 | 436.88 ± 22.06 | 2111.08 ± 102.63 | +| Elixir | 115.81 ± 04.24 | 53.78 ± 00.77 | 2359.25 ± 196.03 | +| Python | 229.53 ± 09.04 | 9.71 ± 00.08 | 4809.67 ± 429.13 | +| Tcl (FP) | 270.07 ± 09.24 | 4.23 ± 00.09 | 5480.68 ± 470.17 | +| Perl | 344.48 ± 18.54 | 6.39 ± 00.07 | 7096.08 ± 460.11 | +| Tcl (OO) | 541.01 ± 16.86 | 4.25 ± 00.06 | 10817.92 ± 1036.36 | ### mandel.b @@ -100,40 +100,40 @@ Testing brainfuck implementations using two code samples (bench.b and mandel.b). | Language | Time, s | Memory, MiB | Energy, J | | :----------------- | -------------: | -------------: | ---------------: | -| C GCC | 12.73 ± 00.54 | 1.71 ± 00.05 | 243.41 ± 19.23 | -| Vala GCC | 13.04 ± 00.46 | 5.78 ± 00.10 | 248.91 ± 18.83 | -| GDC | 14.52 ± 00.70 | 7.22 ± 00.08 | 266.88 ± 28.51 | -| LDC | 14.72 ± 00.65 | 3.83 ± 00.07 | 287.76 ± 27.48 | -| Vala Clang | 15.92 ± 00.51 | 5.76 ± 00.08 | 297.14 ± 23.10 | -| Crystal | 16.73 ± 00.71 | 3.79 ± 00.06 | 325.18 ± 31.01 | -| Rust | 16.80 ± 00.76 | 2.32 ± 00.06 | 335.12 ± 31.25 | -| V GCC | 16.85 ± 00.56 | 2.51 ± 00.07 | 331.93 ± 27.84 | -| C++ | 17.48 ± 00.81 | 3.82 ± 00.05 | 348.86 ± 32.48 | -| C Clang | 17.66 ± 00.66 | 1.69 ± 00.05 | 362.51 ± 30.23 | -| C# .NET Core | 17.87 ± 00.83 | 36.16 ± 00.08 | 327.04 ± 34.94 | -| Nim Clang | 18.28 ± 00.79 | 2.89 ± 00.06 | 369.92 ± 32.93 | -| V Clang | 18.93 ± 00.56 | 2.97 ± 00.07 | 340.57 ± 24.83 | -| Nim GCC | 18.99 ± 00.79 | 2.41 ± 00.05 | 374.46 ± 33.80 | -| Kotlin | 21.13 ± 00.95 | 46.37 ± 00.45 | 425.24 ± 32.19 | -| Java | 21.60 ± 01.50 | 45.42 ± 00.45 | 422.74 ± 44.71 | -| MLton | 22.70 ± 01.05 | 3.91 ± 00.05 | 425.04 ± 41.62 | -| Scala | 24.96 ± 00.54 | 118.94 ± 07.32 | 515.39 ± 29.92 | -| GCC Go | 26.18 ± 01.13 | 29.83 ± 06.26 | 498.08 ± 48.55 | -| OCaml | 32.66 ± 01.16 | 11.91 ± 02.43 | 630.59 ± 48.61 | -| Go | 39.63 ± 01.59 | 4.91 ± 00.23 | 793.74 ± 71.73 | -| Chez Scheme | 40.91 ± 01.49 | 29.38 ± 00.05 | 858.36 ± 62.89 | -| DMD | 43.59 ± 01.46 | 4.41 ± 00.04 | 913.04 ± 67.69 | -| Node.js | 44.21 ± 01.59 | 36.82 ± 00.25 | 822.56 ± 70.17 | -| C# Mono | 47.84 ± 01.84 | 20.95 ± 00.09 | 926.92 ± 82.94 | -| Julia | 59.66 ± 02.16 | 176.64 ± 00.57 | 1153.35 ± 102.21 | -| Haskell MArray | 63.44 ± 01.46 | 6.57 ± 00.05 | 1376.37 ± 76.77 | -| LuaJIT | 65.35 ± 01.74 | 3.89 ± 00.10 | 1335.08 ± 89.21 | -| PyPy | 66.68 ± 01.88 | 109.59 ± 00.24 | 1456.98 ± 99.86 | -| F# .NET Core | 126.22 ± 03.09 | 128.55 ± 00.19 | 2464.69 ± 87.91 | -| TruffleRuby JVM | 132.72 ± 03.30 | 949.02 ± 70.49 | 2581.17 ± 277.96 | -| Racket | 135.59 ± 05.32 | 106.64 ± 00.64 | 2651.50 ± 232.71 | -| TruffleRuby Native | 166.86 ± 02.94 | 605.11 ± 14.49 | 3037.22 ± 95.85 | -| Haskell | 222.54 ± 06.36 | 6.67 ± 00.05 | 4695.16 ± 298.57 | +| C GCC | 12.58 ± 00.55 | 1.60 ± 00.02 | 246.11 ± 23.62 | +| Vala GCC | 12.79 ± 00.61 | 5.64 ± 00.07 | 261.75 ± 25.31 | +| V GCC | 14.31 ± 00.59 | 2.41 ± 00.08 | 292.81 ± 24.00 | +| GDC | 14.60 ± 00.66 | 7.15 ± 00.07 | 263.84 ± 24.75 | +| LDC | 15.42 ± 00.55 | 3.78 ± 00.09 | 286.79 ± 21.82 | +| Vala Clang | 15.87 ± 00.78 | 5.76 ± 00.08 | 306.51 ± 31.64 | +| Crystal | 16.08 ± 00.60 | 3.76 ± 00.04 | 295.03 ± 22.95 | +| C Clang | 17.52 ± 00.78 | 1.58 ± 00.04 | 370.09 ± 34.15 | +| C++ | 17.73 ± 00.62 | 3.68 ± 00.06 | 333.45 ± 28.89 | +| C# .NET Core | 17.83 ± 00.74 | 35.71 ± 00.15 | 332.17 ± 34.57 | +| Rust | 18.04 ± 00.70 | 2.32 ± 00.11 | 362.78 ± 31.17 | +| Nim GCC | 18.34 ± 00.63 | 2.39 ± 00.07 | 353.44 ± 27.76 | +| V Clang | 18.53 ± 00.81 | 2.94 ± 00.19 | 359.60 ± 35.70 | +| Nim Clang | 20.29 ± 00.85 | 2.87 ± 00.05 | 383.41 ± 34.47 | +| Kotlin | 21.23 ± 00.85 | 46.24 ± 00.26 | 402.52 ± 38.88 | +| Java | 21.55 ± 01.31 | 45.19 ± 00.38 | 447.03 ± 62.30 | +| MLton | 22.25 ± 00.82 | 3.75 ± 00.04 | 445.50 ± 36.08 | +| Scala | 24.75 ± 00.62 | 120.67 ± 00.98 | 527.55 ± 30.95 | +| GCC Go | 26.12 ± 01.24 | 26.05 ± 05.95 | 503.29 ± 53.13 | +| OCaml | 32.08 ± 01.15 | 10.69 ± 01.36 | 665.38 ± 49.47 | +| Go | 40.15 ± 01.66 | 4.76 ± 00.25 | 785.16 ± 65.45 | +| Chez Scheme | 40.60 ± 01.61 | 29.35 ± 00.15 | 872.80 ± 78.33 | +| DMD | 44.80 ± 01.60 | 4.38 ± 00.05 | 860.25 ± 76.41 | +| C# Mono | 47.32 ± 01.86 | 21.03 ± 00.09 | 950.04 ± 88.75 | +| Julia | 60.12 ± 01.88 | 176.15 ± 00.85 | 1135.64 ± 82.61 | +| Node.js | 60.21 ± 02.37 | 36.38 ± 00.25 | 1208.97 ± 113.99 | +| Haskell MArray | 62.83 ± 01.62 | 6.53 ± 00.07 | 1318.71 ± 281.21 | +| PyPy | 67.02 ± 02.01 | 109.52 ± 00.07 | 1504.60 ± 106.03 | +| LuaJIT | 67.12 ± 02.11 | 3.63 ± 00.05 | 1275.35 ± 102.17 | +| F# .NET Core | 125.26 ± 03.32 | 128.17 ± 00.20 | 2507.18 ± 70.02 | +| TruffleRuby JVM | 130.09 ± 07.33 | 902.10 ± 41.63 | 2566.12 ± 224.86 | +| Racket | 133.09 ± 04.47 | 106.65 ± 00.65 | 2669.83 ± 190.92 | +| TruffleRuby Native | 163.31 ± 06.71 | 611.69 ± 10.07 | 3249.85 ± 249.63 | +| Haskell | 223.72 ± 07.99 | 6.61 ± 00.07 | 4674.47 ± 405.46 | ## Base64 @@ -141,40 +141,40 @@ Testing base64 encoding/decoding of the large blob into the newly allocated buff [Base64](base64) -| Language | Time, s | Memory, MiB | Energy, J | -| :---------------------- | ------------: | -------------: | -------------: | -| C aklomp | 0.16 ± 00.01 | 2.00 ± 00.04 | 3.69 ± 00.24 | -| C | 1.44 ± 00.08 | 1.98 ± 00.03 | 27.05 ± 02.79 | -| Rust | 1.54 ± 00.07 | 2.59 ± 00.07 | 30.81 ± 03.06 | -| Nim Clang | 1.62 ± 00.09 | 7.96 ± 00.07 | 33.63 ± 04.13 | -| Nim GCC | 1.67 ± 00.10 | 7.47 ± 00.05 | 32.86 ± 03.81 | -| V Clang | 1.79 ± 00.08 | 2.41 ± 00.04 | 37.00 ± 02.71 | -| V GCC | 1.96 ± 00.11 | 1.98 ± 00.04 | 36.75 ± 04.04 | -| Crystal | 2.15 ± 00.01 | 5.19 ± 00.05 | 51.61 ± 02.89 | -| Ruby JIT | 2.18 ± 00.11 | 73.52 ± 00.17 | 44.47 ± 05.31 | -| Ruby | 2.23 ± 00.10 | 73.42 ± 00.16 | 41.19 ± 04.65 | -| LDC | 2.27 ± 00.05 | 3.97 ± 00.04 | 52.72 ± 02.58 | -| GDC | 2.30 ± 00.12 | 10.71 ± 00.07 | 44.72 ± 05.11 | -| Java | 2.52 ± 00.13 | 357.32 ± 18.96 | 52.21 ± 04.65 | -| Kotlin | 2.65 ± 00.14 | 346.86 ± 24.23 | 55.85 ± 04.37 | -| Perl MIME::Base64 | 2.67 ± 00.13 | 7.19 ± 00.06 | 50.28 ± 05.55 | -| Node.js | 2.67 ± 00.10 | 136.51 ± 18.43 | 56.62 ± 05.44 | -| Scala | 2.67 ± 00.10 | 155.36 ± 08.90 | 57.55 ± 03.68 | -| PHP | 2.90 ± 00.15 | 15.42 ± 00.07 | 55.44 ± 06.61 | -| Go | 2.94 ± 00.00 | 9.14 ± 00.24 | 61.38 ± 02.62 | -| C++ libcrypto | 3.06 ± 00.16 | 5.53 ± 00.09 | 65.58 ± 05.80 | -| GCC Go | 3.72 ± 00.01 | 29.66 ± 01.37 | 78.47 ± 03.44 | -| DMD | 4.05 ± 00.18 | 11.55 ± 00.05 | 78.97 ± 06.42 | -| Tcl | 4.24 ± 00.23 | 5.12 ± 00.06 | 79.82 ± 09.45 | -| PyPy | 4.71 ± 00.22 | 109.83 ± 00.25 | 93.96 ± 09.64 | -| Python | 5.13 ± 00.26 | 9.98 ± 00.06 | 98.65 ± 12.01 | -| C# .NET Core | 5.39 ± 00.15 | 73.05 ± 02.35 | 104.32 ± 04.18 | -| Julia | 5.83 ± 00.26 | 250.24 ± 07.61 | 128.33 ± 14.38 | -| TruffleRuby JVM | 6.14 ± 00.15 | 736.40 ± 73.26 | 127.66 ± 07.42 | -| C# Mono | 7.08 ± 00.39 | 40.07 ± 00.08 | 141.32 ± 15.72 | -| JRuby | 10.51 ± 00.59 | 390.07 ± 14.25 | 218.33 ± 20.97 | -| Perl MIME::Base64::Perl | 16.22 ± 00.66 | 8.78 ± 00.10 | 340.22 ± 30.72 | -| TruffleRuby Native | 23.61 ± 00.91 | 502.20 ± 00.13 | 472.10 ± 34.48 | +| Language | Time, s | Memory, MiB | Energy, J | +| :---------------------- | ------------: | --------------: | -------------: | +| C aklomp | 0.16 ± 00.01 | 1.98 ± 00.04 | 3.68 ± 00.25 | +| Rust | 1.33 ± 00.07 | 2.59 ± 00.05 | 25.57 ± 02.67 | +| C | 1.47 ± 00.08 | 1.93 ± 00.04 | 25.85 ± 03.13 | +| Nim Clang | 1.65 ± 00.10 | 7.91 ± 00.08 | 32.95 ± 04.21 | +| Nim GCC | 1.66 ± 00.08 | 7.47 ± 00.04 | 32.99 ± 03.66 | +| V Clang | 2.02 ± 00.12 | 2.42 ± 00.04 | 40.71 ± 04.43 | +| V GCC | 2.13 ± 00.11 | 1.98 ± 00.02 | 40.27 ± 04.43 | +| Crystal | 2.13 ± 00.02 | 5.20 ± 00.07 | 52.52 ± 02.33 | +| LDC | 2.17 ± 00.05 | 10.96 ± 00.05 | 46.26 ± 01.66 | +| Ruby | 2.17 ± 00.11 | 73.34 ± 00.13 | 43.77 ± 05.15 | +| Ruby JIT | 2.20 ± 00.14 | 73.49 ± 00.13 | 43.22 ± 06.30 | +| GDC | 2.29 ± 00.13 | 10.72 ± 00.03 | 45.55 ± 05.16 | +| Java | 2.49 ± 00.08 | 354.41 ± 35.05 | 54.34 ± 05.76 | +| Kotlin | 2.62 ± 00.10 | 351.69 ± 23.74 | 54.55 ± 04.73 | +| Scala | 2.67 ± 00.10 | 155.88 ± 08.04 | 57.99 ± 05.18 | +| Perl MIME::Base64 | 2.68 ± 00.16 | 7.26 ± 00.07 | 50.43 ± 06.67 | +| Node.js | 2.91 ± 00.13 | 1059.21 ± 02.18 | 59.02 ± 05.80 | +| Go | 2.93 ± 00.00 | 9.16 ± 00.53 | 61.68 ± 02.32 | +| C++ libcrypto | 3.12 ± 00.19 | 5.52 ± 00.03 | 63.45 ± 07.86 | +| PHP | 3.15 ± 00.17 | 15.64 ± 00.06 | 64.64 ± 07.72 | +| GCC Go | 3.68 ± 00.02 | 29.83 ± 01.18 | 78.09 ± 02.81 | +| DMD | 4.01 ± 00.15 | 11.56 ± 00.06 | 79.26 ± 06.01 | +| Tcl | 4.28 ± 00.23 | 5.05 ± 00.03 | 78.37 ± 09.61 | +| PyPy | 4.83 ± 00.20 | 109.72 ± 00.39 | 88.87 ± 08.93 | +| C# .NET Core | 5.25 ± 00.16 | 72.23 ± 02.87 | 103.33 ± 05.43 | +| Python | 5.38 ± 00.28 | 9.82 ± 00.10 | 104.01 ± 12.29 | +| Julia | 5.95 ± 00.24 | 258.94 ± 09.04 | 124.44 ± 14.78 | +| TruffleRuby JVM | 6.31 ± 00.20 | 743.00 ± 92.15 | 121.49 ± 09.61 | +| C# Mono | 6.85 ± 00.32 | 39.47 ± 00.05 | 135.66 ± 15.68 | +| JRuby | 10.49 ± 00.71 | 368.64 ± 36.40 | 204.51 ± 15.30 | +| Perl MIME::Base64::Perl | 16.17 ± 00.71 | 8.96 ± 00.09 | 328.73 ± 28.29 | +| TruffleRuby Native | 23.07 ± 00.90 | 500.61 ± 00.11 | 475.35 ± 46.47 | ## Json @@ -182,56 +182,56 @@ Testing parsing and simple calculating of values from a big JSON file. [Json](json) -| Language | Time, s | Memory, MiB | Energy, J | -| :-------------------- | ------------: | --------------: | --------------: | -| C++ DAW JSON Link | 0.10 ± 00.00 | 109.30 ± 00.04 | 1.95 ± 00.22 | -| GDC fast | 0.10 ± 00.01 | 231.19 ± 00.21 | 2.46 ± 00.26 | -| Rust Serde Custom | 0.15 ± 00.01 | 108.49 ± 00.09 | 2.96 ± 00.31 | -| Rust Serde Typed | 0.16 ± 00.01 | 120.21 ± 00.32 | 3.20 ± 00.43 | -| C++ simdjson | 0.16 ± 00.01 | 286.62 ± 00.38 | 3.69 ± 00.43 | -| C++ gason | 0.17 ± 00.01 | 206.43 ± 00.04 | 3.86 ± 00.40 | -| C++ RapidJSON | 0.23 ± 00.01 | 238.19 ± 00.06 | 4.83 ± 00.52 | -| Java | 0.51 ± 00.02 | 337.77 ± 01.13 | 13.88 ± 00.36 | -| C++ RapidJSON SAX | 0.55 ± 00.03 | 109.48 ± 00.07 | 11.07 ± 01.23 | -| Scala | 0.56 ± 00.02 | 403.48 ± 03.91 | 15.03 ± 01.27 | -| Node.js | 0.67 ± 00.02 | 323.91 ± 01.10 | 16.45 ± 01.19 | -| Go jsoniter | 0.71 ± 00.02 | 226.33 ± 00.32 | 15.17 ± 01.25 | -| Crystal Schema | 0.78 ± 00.05 | 157.27 ± 00.15 | 15.54 ± 01.56 | -| Crystal Pull | 0.79 ± 00.05 | 128.51 ± 00.04 | 13.96 ± 01.66 | -| Julia JSON3 | 0.81 ± 00.04 | 543.80 ± 12.10 | 17.45 ± 01.82 | -| PyPy | 0.82 ± 00.05 | 404.68 ± 00.08 | 17.79 ± 02.20 | -| Rust Serde Untyped | 0.92 ± 00.03 | 916.44 ± 00.09 | 20.20 ± 01.34 | -| Perl Cpanel::JSON::XS | 0.99 ± 00.05 | 524.24 ± 00.08 | 21.16 ± 02.35 | -| Crystal | 1.10 ± 00.06 | 503.61 ± 00.03 | 22.80 ± 02.12 | -| V Clang | 1.15 ± 00.05 | 591.27 ± 00.61 | 25.06 ± 01.91 | -| V GCC | 1.16 ± 00.05 | 591.16 ± 00.72 | 24.66 ± 02.48 | -| Go | 1.19 ± 00.06 | 209.73 ± 00.30 | 22.55 ± 02.15 | -| PHP | 1.28 ± 00.05 | 803.45 ± 00.08 | 24.30 ± 02.10 | -| GCC Go | 1.46 ± 00.08 | 231.60 ± 05.96 | 28.60 ± 03.67 | -| Nim Packedjson GCC | 1.54 ± 00.11 | 399.35 ± 00.05 | 31.83 ± 03.79 | -| Clojure | 1.54 ± 00.05 | 958.30 ± 30.99 | 43.23 ± 02.27 | -| Nim Packedjson Clang | 1.57 ± 00.08 | 399.85 ± 00.05 | 30.85 ± 03.41 | -| C++ json-c | 1.69 ± 00.08 | 1649.58 ± 00.08 | 36.21 ± 03.80 | -| CPython UltraJSON | 1.72 ± 00.04 | 660.95 ± 02.22 | 37.06 ± 01.07 | -| Haskell | 1.80 ± 00.09 | 9.58 ± 00.06 | 36.81 ± 04.33 | -| Python | 1.81 ± 00.05 | 493.65 ± 00.04 | 38.12 ± 02.16 | -| Nim GCC | 1.86 ± 00.07 | 904.83 ± 00.16 | 39.94 ± 03.20 | -| Nim Clang | 1.87 ± 00.08 | 905.21 ± 00.10 | 41.08 ± 03.51 | -| C# .NET Core | 2.05 ± 00.11 | 761.41 ± 00.10 | 41.40 ± 05.37 | -| Ruby | 2.25 ± 00.10 | 396.87 ± 00.05 | 46.57 ± 05.34 | -| Ruby JIT | 2.26 ± 00.09 | 396.96 ± 00.06 | 50.66 ± 04.21 | -| GDC | 2.26 ± 00.11 | 713.47 ± 00.09 | 44.04 ± 05.04 | -| Ruby YAJL | 2.27 ± 00.09 | 406.19 ± 00.10 | 47.19 ± 04.90 | -| LDC | 2.61 ± 00.06 | 789.67 ± 00.13 | 53.23 ± 01.87 | -| C# Mono | 2.78 ± 00.08 | 462.62 ± 00.10 | 49.92 ± 03.60 | -| Rust jq | 3.66 ± 00.14 | 885.77 ± 01.23 | 77.74 ± 06.47 | -| JRuby | 3.86 ± 00.10 | 1945.10 ± 35.50 | 118.64 ± 06.22 | -| C++ Boost | 3.99 ± 00.16 | 1549.71 ± 00.05 | 92.27 ± 08.22 | -| DMD | 4.95 ± 00.20 | 790.36 ± 00.07 | 97.80 ± 06.64 | -| C# System.Text.Json | 6.68 ± 00.32 | 647.14 ± 00.06 | 150.34 ± 14.24 | -| Perl JSON::Tiny | 11.98 ± 00.52 | 647.27 ± 00.10 | 230.18 ± 24.94 | -| TruffleRuby JVM | 19.77 ± 00.66 | 2022.78 ± 86.17 | 540.06 ± 21.90 | -| TruffleRuby Native | 53.80 ± 01.82 | 2747.48 ± 79.90 | 1163.16 ± 94.78 | +| Language | Time, s | Memory, MiB | Energy, J | +| :-------------------- | ------------: | ---------------: | --------------: | +| C++ DAW JSON Link | 0.09 ± 00.00 | 109.33 ± 00.05 | 1.86 ± 00.24 | +| GDC fast | 0.10 ± 00.00 | 231.36 ± 00.32 | 2.41 ± 00.24 | +| Rust Serde Custom | 0.13 ± 00.01 | 108.48 ± 00.12 | 2.73 ± 00.25 | +| Rust Serde Typed | 0.15 ± 00.01 | 120.11 ± 00.32 | 3.01 ± 00.32 | +| C++ simdjson | 0.16 ± 00.01 | 286.25 ± 00.82 | 3.72 ± 00.55 | +| C++ gason | 0.17 ± 00.01 | 206.42 ± 00.09 | 3.60 ± 00.37 | +| C++ RapidJSON | 0.23 ± 00.01 | 238.15 ± 00.08 | 4.89 ± 00.58 | +| Java | 0.51 ± 00.01 | 337.24 ± 01.15 | 13.57 ± 00.64 | +| C++ RapidJSON SAX | 0.56 ± 00.03 | 109.49 ± 00.05 | 10.62 ± 01.16 | +| Scala | 0.57 ± 00.02 | 402.22 ± 01.34 | 14.48 ± 01.12 | +| Node.js | 0.67 ± 00.03 | 429.89 ± 00.91 | 15.70 ± 01.25 | +| Go jsoniter | 0.71 ± 00.03 | 226.16 ± 00.24 | 14.96 ± 01.21 | +| Crystal Pull | 0.78 ± 00.06 | 128.51 ± 00.05 | 13.88 ± 01.95 | +| PyPy | 0.80 ± 00.03 | 404.73 ± 00.15 | 18.71 ± 01.94 | +| Crystal Schema | 0.81 ± 00.05 | 157.26 ± 00.13 | 14.94 ± 01.90 | +| Julia JSON3 | 0.83 ± 00.02 | 633.71 ± 03.12 | 19.93 ± 00.99 | +| Rust Serde Untyped | 0.87 ± 00.03 | 948.48 ± 00.06 | 19.05 ± 01.50 | +| Perl Cpanel::JSON::XS | 0.96 ± 00.03 | 524.39 ± 00.08 | 21.13 ± 01.87 | +| Crystal | 1.09 ± 00.07 | 503.65 ± 00.05 | 22.28 ± 02.56 | +| V GCC | 1.14 ± 00.07 | 590.72 ± 00.61 | 23.86 ± 02.92 | +| Go | 1.15 ± 00.06 | 209.53 ± 00.30 | 23.88 ± 02.83 | +| V Clang | 1.20 ± 00.06 | 591.03 ± 00.70 | 22.73 ± 02.89 | +| PHP | 1.23 ± 00.06 | 803.61 ± 00.10 | 24.30 ± 02.31 | +| GCC Go | 1.42 ± 00.08 | 232.08 ± 05.84 | 29.91 ± 03.58 | +| Nim Packedjson GCC | 1.51 ± 00.07 | 399.35 ± 00.02 | 30.52 ± 04.42 | +| Nim Packedjson Clang | 1.55 ± 00.12 | 399.83 ± 00.06 | 30.50 ± 02.76 | +| Clojure | 1.58 ± 00.08 | 974.60 ± 34.94 | 39.95 ± 02.90 | +| C++ json-c | 1.62 ± 00.06 | 1649.58 ± 00.06 | 38.66 ± 02.75 | +| CPython UltraJSON | 1.64 ± 00.04 | 661.58 ± 02.49 | 35.39 ± 01.44 | +| Python | 1.74 ± 00.04 | 493.52 ± 00.07 | 38.23 ± 02.02 | +| Haskell | 1.78 ± 00.10 | 9.72 ± 00.05 | 36.43 ± 04.49 | +| Nim GCC | 1.86 ± 00.08 | 904.85 ± 00.13 | 36.62 ± 03.61 | +| Nim Clang | 1.88 ± 00.08 | 905.30 ± 00.11 | 37.72 ± 03.88 | +| C# .NET Core | 2.08 ± 00.11 | 761.07 ± 00.10 | 39.73 ± 05.21 | +| C# Mono | 2.17 ± 00.13 | 462.42 ± 00.13 | 43.94 ± 05.05 | +| Ruby JIT | 2.21 ± 00.09 | 397.03 ± 00.05 | 51.96 ± 04.49 | +| Ruby | 2.28 ± 00.07 | 396.82 ± 00.06 | 44.05 ± 03.74 | +| Ruby YAJL | 2.28 ± 00.09 | 406.23 ± 00.11 | 46.43 ± 05.99 | +| GDC | 2.29 ± 00.16 | 713.58 ± 00.05 | 43.39 ± 05.10 | +| LDC | 2.51 ± 00.06 | 789.57 ± 00.06 | 52.35 ± 02.38 | +| Rust jq | 3.76 ± 00.21 | 886.16 ± 00.70 | 71.57 ± 07.46 | +| JRuby | 3.86 ± 00.12 | 1955.12 ± 41.38 | 115.41 ± 07.62 | +| C++ Boost | 3.95 ± 00.18 | 1549.75 ± 00.07 | 89.29 ± 09.82 | +| DMD | 4.89 ± 00.14 | 790.32 ± 00.09 | 97.55 ± 05.20 | +| C# System.Text.Json | 6.83 ± 00.39 | 646.99 ± 00.15 | 135.90 ± 18.07 | +| Perl JSON::Tiny | 11.90 ± 00.50 | 647.40 ± 00.11 | 243.43 ± 27.21 | +| TruffleRuby JVM | 19.30 ± 00.62 | 2038.99 ± 69.88 | 546.16 ± 13.79 | +| TruffleRuby Native | 53.27 ± 01.61 | 2820.76 ± 144.45 | 1080.59 ± 92.07 | ## Matmul @@ -241,42 +241,42 @@ Testing allocating and multiplying matrices. | Language | Time, s | Memory, MiB | Energy, J | | :-------------------- | -------------: | --------------: | ----------------: | -| LDC lubeck | 0.13 ± 00.00 | 61.47 ± 00.20 | 7.75 ± 00.20 | -| Nim Clang Arraymancer | 0.15 ± 00.05 | 56.34 ± 00.22 | 7.41 ± 01.32 | -| Nim GCC Arraymancer | 0.16 ± 00.06 | 56.38 ± 00.12 | 8.10 ± 01.47 | -| Python NumPy | 0.19 ± 00.01 | 84.75 ± 00.13 | 9.96 ± 00.58 | -| Java ND4J | 0.19 ± 00.03 | 240.06 ± 02.92 | 9.57 ± 00.71 | -| Julia (threads: 8) | 0.43 ± 00.02 | 290.51 ± 00.41 | 19.10 ± 00.88 | -| Julia (threads: 1) | 0.71 ± 00.03 | 290.65 ± 00.39 | 15.85 ± 01.46 | -| LDC | 1.96 ± 00.01 | 73.61 ± 00.05 | 43.86 ± 01.04 | -| DMD | 2.10 ± 00.02 | 74.14 ± 00.14 | 47.66 ± 01.16 | -| GDC | 2.10 ± 00.03 | 77.40 ± 00.06 | 47.54 ± 02.37 | -| C | 3.32 ± 00.02 | 70.19 ± 00.07 | 68.78 ± 02.13 | -| Java | 3.32 ± 00.03 | 124.13 ± 00.62 | 76.47 ± 01.35 | -| Rust | 3.35 ± 00.01 | 70.97 ± 00.08 | 69.07 ± 02.34 | -| Scala | 3.41 ± 00.04 | 164.67 ± 02.25 | 79.37 ± 01.50 | -| Nim GCC | 3.44 ± 00.15 | 79.95 ± 06.37 | 67.80 ± 07.48 | -| Nim Clang | 3.48 ± 00.18 | 76.71 ± 04.02 | 68.41 ± 08.11 | -| GCC Go | 3.51 ± 00.03 | 95.13 ± 03.94 | 75.49 ± 02.52 | -| Go | 3.60 ± 00.10 | 76.72 ± 00.22 | 74.12 ± 05.07 | -| Swift | 3.62 ± 00.10 | 205.05 ± 00.23 | 77.10 ± 04.12 | -| V GCC | 3.64 ± 00.12 | 70.74 ± 00.15 | 76.63 ± 05.60 | -| Julia (no BLAS) | 3.64 ± 00.07 | 252.16 ± 00.74 | 76.15 ± 02.71 | -| Crystal | 3.71 ± 00.20 | 63.74 ± 00.04 | 75.08 ± 09.14 | -| V Clang | 3.79 ± 00.16 | 71.26 ± 00.06 | 80.58 ± 09.85 | -| Kotlin | 4.04 ± 00.13 | 122.80 ± 00.11 | 76.52 ± 06.62 | -| Node.js | 5.48 ± 00.23 | 104.62 ± 00.46 | 109.61 ± 13.66 | -| PyPy | 6.11 ± 00.20 | 133.04 ± 00.23 | 132.44 ± 10.66 | -| C# .NET Core | 7.01 ± 00.31 | 102.71 ± 00.19 | 145.63 ± 13.66 | -| C# Mono | 10.39 ± 00.41 | 89.27 ± 00.13 | 202.31 ± 22.87 | -| TruffleRuby Native | 29.30 ± 00.67 | 719.89 ± 19.82 | 635.30 ± 32.04 | -| TruffleRuby JVM | 41.16 ± 00.42 | 1005.51 ± 52.51 | 963.95 ± 22.59 | -| Ruby JIT | 211.73 ± 08.09 | 84.19 ± 00.05 | 4142.66 ± 339.16 | -| Ruby | 230.50 ± 07.36 | 83.94 ± 00.08 | 4421.55 ± 430.79 | -| Python | 253.37 ± 06.63 | 78.75 ± 00.05 | 5005.83 ± 491.37 | -| Tcl | 353.73 ± 06.63 | 407.59 ± 00.07 | 7317.93 ± 549.38 | -| Perl | 397.81 ± 06.14 | 608.42 ± 00.08 | 8642.06 ± 608.42 | -| JRuby | 486.73 ± 26.67 | 989.22 ± 197.84 | 10799.30 ± 800.81 | +| Nim Clang Arraymancer | 0.14 ± 00.01 | 56.22 ± 00.09 | 7.86 ± 00.26 | +| LDC lubeck | 0.14 ± 00.00 | 61.40 ± 00.15 | 8.03 ± 00.20 | +| Nim GCC Arraymancer | 0.15 ± 00.00 | 56.27 ± 00.14 | 8.67 ± 00.18 | +| Java ND4J | 0.19 ± 00.02 | 239.27 ± 02.95 | 9.30 ± 01.26 | +| Python NumPy | 0.21 ± 00.01 | 79.96 ± 00.06 | 10.89 ± 00.89 | +| Julia (threads: 8) | 0.43 ± 00.02 | 290.68 ± 00.31 | 18.90 ± 00.64 | +| Julia (threads: 1) | 0.72 ± 00.03 | 290.65 ± 00.28 | 15.28 ± 01.61 | +| LDC | 1.97 ± 00.01 | 73.64 ± 00.05 | 43.62 ± 01.36 | +| DMD | 2.13 ± 00.03 | 74.19 ± 00.16 | 46.74 ± 01.72 | +| GDC | 2.13 ± 00.05 | 77.40 ± 00.08 | 46.84 ± 02.98 | +| Java | 3.31 ± 00.03 | 124.31 ± 00.26 | 76.87 ± 02.10 | +| C | 3.33 ± 00.02 | 70.21 ± 00.07 | 68.73 ± 02.46 | +| Rust | 3.37 ± 00.02 | 70.99 ± 00.09 | 69.07 ± 02.88 | +| Nim GCC | 3.42 ± 00.04 | 77.49 ± 07.19 | 69.68 ± 04.32 | +| Scala | 3.42 ± 00.05 | 167.17 ± 06.40 | 79.18 ± 03.54 | +| Nim Clang | 3.44 ± 00.03 | 81.10 ± 05.61 | 70.90 ± 04.19 | +| GCC Go | 3.58 ± 00.05 | 102.85 ± 05.74 | 75.68 ± 02.42 | +| Go | 3.59 ± 00.08 | 76.85 ± 00.25 | 74.21 ± 03.61 | +| Julia (no BLAS) | 3.66 ± 00.08 | 252.30 ± 00.49 | 76.44 ± 02.54 | +| Crystal | 3.68 ± 00.08 | 63.79 ± 00.06 | 77.36 ± 03.24 | +| Swift | 3.69 ± 00.10 | 207.16 ± 06.38 | 75.69 ± 04.82 | +| V GCC | 3.70 ± 00.15 | 70.87 ± 00.07 | 76.38 ± 08.59 | +| V Clang | 3.83 ± 00.15 | 71.31 ± 00.05 | 80.89 ± 10.38 | +| Kotlin | 3.83 ± 00.31 | 123.00 ± 00.46 | 80.38 ± 08.57 | +| Node.js | 5.45 ± 00.24 | 104.58 ± 00.64 | 111.33 ± 13.69 | +| PyPy | 6.31 ± 00.28 | 132.91 ± 00.12 | 124.90 ± 13.76 | +| C# .NET Core | 7.06 ± 00.30 | 102.39 ± 00.17 | 142.13 ± 14.23 | +| C# Mono | 11.29 ± 00.51 | 89.07 ± 00.05 | 208.51 ± 19.70 | +| TruffleRuby Native | 28.84 ± 00.62 | 719.77 ± 20.73 | 646.51 ± 50.78 | +| TruffleRuby JVM | 40.95 ± 00.62 | 989.06 ± 45.47 | 947.37 ± 40.99 | +| Ruby JIT | 221.07 ± 07.97 | 84.19 ± 00.07 | 3957.84 ± 440.43 | +| Ruby | 227.27 ± 08.71 | 83.89 ± 00.06 | 4474.48 ± 444.37 | +| Python | 251.18 ± 10.09 | 78.63 ± 00.06 | 5055.99 ± 504.82 | +| Tcl | 353.54 ± 10.47 | 407.63 ± 00.06 | 6974.97 ± 474.03 | +| Perl | 394.69 ± 08.78 | 608.48 ± 00.12 | 7980.59 ± 2772.79 | +| JRuby | 478.94 ± 18.93 | 982.83 ± 167.84 | 10523.90 ± 432.37 | ## Havlak @@ -286,20 +286,20 @@ Testing Havlak's loop finder implementations. | Language | Time, s | Memory, MiB | Energy, J | | :----------- | -------------: | ---------------: | ---------------: | -| Crystal | 6.78 ± 00.12 | 212.04 ± 01.09 | 164.88 ± 08.38 | -| Nim GCC | 11.91 ± 00.28 | 479.60 ± 11.84 | 276.72 ± 21.65 | -| Nim Clang | 12.24 ± 00.27 | 486.60 ± 12.88 | 270.83 ± 21.23 | -| C++ | 13.80 ± 00.21 | 178.32 ± 00.06 | 296.32 ± 11.14 | -| C# .NET Core | 15.01 ± 00.37 | 1508.10 ± 134.56 | 357.34 ± 28.55 | -| Go | 18.70 ± 00.12 | 358.30 ± 10.14 | 436.77 ± 07.09 | -| Scala | 18.78 ± 00.41 | 733.99 ± 295.97 | 578.36 ± 20.69 | -| LDC | 19.22 ± 00.45 | 474.38 ± 27.65 | 457.12 ± 21.69 | -| GDC | 22.13 ± 00.74 | 361.71 ± 32.53 | 469.49 ± 31.43 | -| DMD | 23.46 ± 00.16 | 441.00 ± 00.74 | 560.86 ± 09.55 | -| C# Mono | 25.44 ± 00.33 | 334.11 ± 00.69 | 543.68 ± 30.78 | -| GCC Go | 26.37 ± 00.31 | 379.97 ± 17.02 | 656.82 ± 07.86 | -| PyPy | 29.14 ± 00.81 | 663.59 ± 67.98 | 640.75 ± 42.90 | -| Python | 106.33 ± 01.82 | 405.67 ± 00.05 | 2253.50 ± 125.39 | +| Crystal | 6.90 ± 00.35 | 212.29 ± 01.24 | 157.84 ± 20.27 | +| Nim GCC | 11.72 ± 00.41 | 481.89 ± 10.62 | 259.41 ± 28.82 | +| Nim Clang | 12.21 ± 00.39 | 479.58 ± 02.70 | 252.95 ± 28.43 | +| C++ | 14.20 ± 00.49 | 178.33 ± 00.07 | 286.27 ± 29.40 | +| C# .NET Core | 15.05 ± 00.95 | 1395.71 ± 134.02 | 341.69 ± 58.46 | +| Go | 18.72 ± 00.11 | 353.66 ± 09.63 | 435.16 ± 06.41 | +| LDC | 18.81 ± 00.29 | 469.03 ± 18.56 | 488.31 ± 22.18 | +| Scala | 19.15 ± 01.31 | 762.87 ± 277.05 | 544.31 ± 57.54 | +| GDC | 22.47 ± 00.67 | 351.47 ± 00.06 | 459.13 ± 33.01 | +| DMD | 23.45 ± 00.26 | 470.75 ± 10.78 | 563.73 ± 14.59 | +| GCC Go | 26.40 ± 00.59 | 386.30 ± 18.31 | 648.70 ± 13.90 | +| C# Mono | 28.22 ± 02.32 | 338.05 ± 10.17 | 458.32 ± 84.58 | +| PyPy | 29.25 ± 00.90 | 649.62 ± 60.58 | 627.23 ± 49.19 | +| Python | 104.78 ± 02.32 | 409.38 ± 00.05 | 2306.60 ± 146.07 | # Tests Execution @@ -311,45 +311,45 @@ Base Docker image: Debian GNU/Linux bullseye/sid | Language | Version | | ------------ | ------------------------------- | -| .NET Core | 3.1.105 | +| .NET Core | 3.1.106 | | C# .NET Core | 3.4.1-beta4-20127-10 (d8180a5e) | -| C# Mono | 6.8.0.123 | +| C# Mono | 6.10.0.104 | | Chez Scheme | 9.5 | -| Clang | 10.0.0 | +| Clang | 10.0.1 | | Clojure | "1.10.1" | -| Crystal | 0.35.0 | -| DMD | v2.092.1 | +| Crystal | 0.35.1 | +| DMD | v2.093.0 | | Elixir | 1.10.3 | | F# .NET Core | 10.7.0.0 for F# 4.7 | | GCC | 10.1.0 | | GCC Go | 10.1.0 | | GDC | 10.1.0 | -| Go | go1.14.4 | +| Go | go1.14.6 | | Haskell | 8.10.1 | -| JRuby | 9.2.11.1 | -| Java | 14.0.1 | +| JRuby | 9.2.12.0 | +| Java | 14.0.2 | | Julia | v"1.4.2" | | Kotlin | 1.3.72 | -| LDC | 1.21.0 | -| Lua | Lua 5.3 | +| LDC | 1.22.0 | +| Lua | Lua 5.4 | | LuaJIT | LuaJIT 2.1.0-beta3 | | MLton | 20180207 | -| Nim | 1.2.0 | -| Node.js | v14.4.0 | +| Nim | 1.2.4 | +| Node.js | v14.5.0 | | OCaml | 4.10.0 | -| PHP | 7.3.15-3 | -| Perl | v5.30.2 | +| PHP | 7.4.5 | +| Perl | v5.30.3 | | PyPy | 7.3.1-final0 for Python 3.6.9 | -| Python | 3.8.3 | +| Python | 3.8.4 | | Racket | "7.7" | | Ruby | 2.7.1p83 | -| Rust | 1.44.0 | -| Scala | 2.13.2 | +| Rust | 1.45.0 | +| Scala | 2.13.3 | | Swift | swift-5.2.4-RELEASE | | Tcl | 8.6 | | TruffleRuby | 20.1.0 | -| V | 0.1.27 | -| Vala | 0.48.6 | +| V | 0.1.28 | +| Vala | 0.48.7 | ## Using Docker @@ -439,11 +439,8 @@ For Java, Scala: For Lua: - - [LuaSocket](http://w3.impa.br/~diego/software/luasocket/) for TCP -connectivity between the tests and the test runner -(Debian package `lua-socket`). - - [luaposix](http://luaposix.github.io/luaposix/) for getting PID of the -tests (Debian package `lua-posix`). + - [LuaRocks](https://luarocks.org/) for installing dependencies +(Debian package `luarocks`). For Haskell: diff --git a/base64/base64.rs/Cargo.lock b/base64/base64.rs/Cargo.lock index d4b22790..66f4d227 100644 --- a/base64/base64.rs/Cargo.lock +++ b/base64/base64.rs/Cargo.lock @@ -2,15 +2,15 @@ # It is not intended for manual editing. [[package]] name = "base64" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "base64_rs" version = "0.0.1" dependencies = [ - "base64 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [metadata] -"checksum base64 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "53d1ccbaf7d9ec9537465a97bf19edc1a4e158ecb49fc16178202238c569cc42" +"checksum base64 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" diff --git a/base64/base64.rs/Cargo.toml b/base64/base64.rs/Cargo.toml index be7d596b..e31f2f45 100644 --- a/base64/base64.rs/Cargo.toml +++ b/base64/base64.rs/Cargo.toml @@ -4,7 +4,7 @@ version = "0.0.1" edition = "2018" [dependencies] -base64 = "0.12.1" +base64 = "0.12.3" [profile.release] lto = true diff --git a/base64/test-xs.pl b/base64/test-xs.pl index 6b3f5c8f..035aee8f 100644 --- a/base64/test-xs.pl +++ b/base64/test-xs.pl @@ -1,5 +1,8 @@ -use strict; +use v5.12; use warnings; +use feature qw(signatures); +no warnings qw(experimental::signatures); + use MIME::Base64 qw(encode_base64 decode_base64); use Time::HiRes 'time'; use Socket; @@ -9,8 +12,7 @@ my $str = 'a' x STR_SIZE; -sub notify { - my $msg = shift; +sub notify ($msg) { socket(my $socket, Socket::PF_INET, Socket::SOCK_STREAM, (getprotobyname('tcp'))[2]); if (connect($socket, Socket::pack_sockaddr_in(9001, Socket::inet_aton('localhost')))) { print $socket $msg; diff --git a/base64/test.pl b/base64/test.pl index 83fc20ad..eebb4b05 100644 --- a/base64/test.pl +++ b/base64/test.pl @@ -1,11 +1,13 @@ -use strict; +use v5.12; use warnings; +use feature qw(signatures); +no warnings qw(experimental::signatures); + use MIME::Base64::Perl qw(encode_base64 decode_base64); use Time::HiRes 'time'; use Socket; -sub notify { - my $msg = shift; +sub notify ($msg) { socket(my $socket, Socket::PF_INET, Socket::SOCK_STREAM, (getprotobyname('tcp'))[2]); if (connect($socket, Socket::pack_sockaddr_in(9001, Socket::inet_aton('localhost')))) { print $socket $msg; diff --git a/base64/test.v b/base64/test.v index cd5cf4b8..20d93bf3 100644 --- a/base64/test.v +++ b/base64/test.v @@ -6,10 +6,8 @@ fn notify(msg string) { sock := net.dial('127.0.0.1', 9001) or { return } - sock.write(msg) or { - } - sock.close() or { - } + sock.write(msg) or { } + sock.close() or { } } fn main() { @@ -20,7 +18,7 @@ fn main() { $if clang { lang = 'V Clang' } - notify('${lang}\t${C.getpid()}') + notify('$lang\t$C.getpid()') mut bench := benchmark.new_benchmark() bench.step() mut s := 0 diff --git a/brainfuck/Makefile b/brainfuck/Makefile index 9da515b3..d43a9fce 100644 --- a/brainfuck/Makefile +++ b/brainfuck/Makefile @@ -206,10 +206,20 @@ run[truby-native][bf.rb]:: run[truby-native][%]: % | $(rubocop) run[jruby][bf.rb]:: run[jruby][%]: % | $(rubocop) $(JRUBY_RUN) $(BF_SRC) -run[bf.lua]:: run[%]: % +.PHONY: lua-deps +lua-deps: + $(LUAROCKS_LUA) install luasocket + $(LUAROCKS_LUA) install luaposix + +.PHONY: luajit-deps +luajit-deps: + $(LUAROCKS_LUAJIT) install luasocket + $(LUAROCKS_LUAJIT) install luaposix + +run[bf.lua]:: run[%]: % | lua-deps $(LUA_RUN) $(BF_SRC) -run[jit][bf.lua]:: run[jit][%]: % +run[jit][bf.lua]:: run[jit][%]: % | luajit-deps $(LUA_JIT_RUN) $(BF_SRC) run[bf.tcl]:: run[%]: % diff --git a/brainfuck/bf.pl b/brainfuck/bf.pl index 1c0b8782..a90dad16 100644 --- a/brainfuck/bf.pl +++ b/brainfuck/bf.pl @@ -1,18 +1,15 @@ #! /usr/bin/env perl -use 5.10.1; -use strict; +use v5.12; use warnings; +use feature qw(signatures); +no warnings qw(experimental); + use Socket; -no warnings 'experimental'; package Op; -sub new { - my $class = shift; - my $op = shift; - my $val = shift; - +sub new ($class, $op, $val = undef) { my $self = { op => $op, val => $val, @@ -24,9 +21,7 @@ sub new { package Tape; -sub new { - my $class = shift; - +sub new ($class) { my $self = { tape => [0], pos => 0, @@ -35,23 +30,15 @@ sub new { return $self; } -sub get { - my $self = shift; - +sub get ($self) { return $self->{tape}[$self->{pos}]; } -sub inc { - my $self = shift; - my $x = shift; - +sub inc ($self, $x) { $self->{tape}[$self->{pos}] += $x; } -sub move { - my $self = shift; - my $x = shift; - +sub move ($self, $x) { $self->{pos} += $x; my $missing = $self->{pos} - @{$self->{tape}} + 1; for (my $i = 0; $i < $missing; $i++) { @@ -67,10 +54,7 @@ package Main; my $PRINT = 3; my $LOOP = 4; -sub parse { - my $source = shift; - my $i = shift || 0; - +sub parse ($source, $i = 0) { my $repr = []; for (; $i < @{$source}; $i++) { given ($source->[$i]) { @@ -90,9 +74,7 @@ sub parse { return ($repr, $i); } -sub run { - my $parsed = shift; - my $tape = shift; +sub run ($parsed, $tape) { foreach my $op (@$parsed) { CORE::given ($op->{op}) { when ($INC) { $tape->inc($op->{val}); } @@ -107,8 +89,7 @@ sub run { } } -sub notify { - my $msg = shift; +sub notify ($msg) { socket(my $socket, Socket::PF_INET, Socket::SOCK_STREAM, (getprotobyname('tcp'))[2]); if (connect($socket, Socket::pack_sockaddr_in(9001, Socket::inet_aton('localhost')))) { print $socket $msg; diff --git a/brainfuck/bf.v b/brainfuck/bf.v index b86dd889..b7da2906 100644 --- a/brainfuck/bf.v +++ b/brainfuck/bf.v @@ -62,7 +62,7 @@ struct Program { } fn new_program(code string) Program { - si := new_si(code) + mut si := new_si(code) return Program{ ops: parse(mut si) } @@ -142,10 +142,8 @@ fn notify(msg string) { sock := net.dial('127.0.0.1', 9001) or { return } - sock.write(msg) or { - } - sock.close() or { - } + sock.write(msg) or { } + sock.close() or { } } fn main() { @@ -165,7 +163,7 @@ fn main() { $if clang { lang = 'V Clang' } - notify('${lang}\t${C.getpid()}') + notify('$lang\t$C.getpid()') new_program(code).run() notify('stop') } diff --git a/common/commands.mk b/common/commands.mk index 10a5a467..6ba9df11 100644 --- a/common/commands.mk +++ b/common/commands.mk @@ -43,6 +43,9 @@ ECHO_RUN = @tput bold; echo "$(MAKE) $@"; tput sgr0 XTIME := ../xtime.rb CPANM := cpanm +LUAROCKS_LUA = PATH=$(PATH):/opt/luarocks/lua/bin luarocks +LUAROCKS_LUAJIT = PATH=$(PATH):/opt/luarocks/luajit/bin luarocks + CLOJURE_RUN = $(XTIME) clojure $(CLOJURE_FLAGS) $^ DOTNET_RUN = $(XTIME) dotnet $^ ELIXIR_RUN = $(XTIME) elixir $^ @@ -50,8 +53,8 @@ EXECUTABLE_RUN = $(XTIME) $^ JAVA_CLASS_RUN = $(XTIME) java -cp $(^D) $(basename $(^F)) JAVA_JAR_RUN = $(XTIME) java -jar $^ JRUBY_RUN = $(XTIME) jruby $^ -LUA_JIT_RUN = $(XTIME) luajit $^ -LUA_RUN = $(XTIME) lua5.3 $^ +LUA_JIT_RUN = $(shell $(LUAROCKS_LUAJIT) path) && $(XTIME) luajit $^ +LUA_RUN = $(shell $(LUAROCKS_LUA) path) && $(XTIME) lua $^ MONO_RUN = $(XTIME) mono -O=all --gc=sgen $^ NODE_RUN = $(XTIME) node $^ PERL_RUN = $(XTIME) perl $^ diff --git a/docker/Dockerfile b/docker/Dockerfile index 0053d653..c0b62ecf 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,36 +1,27 @@ FROM debian:testing +ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 RUN apt-get update \ - && apt-get install -y --no-install-recommends gnupg dirmngr \ - && rm -rf /var/lib/apt/lists/* \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg --batch --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \ - && gpg --batch --export --armor 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF > /etc/apt/trusted.gpg.d/mono.gpg.asc \ - && gpgconf --kill all \ - && rm -rf "$GNUPGHOME" \ - && apt-key list | grep Xamarin \ - && apt-get purge -y --auto-remove gnupg dirmngr - -# https://www.mono-project.com/download/stable/ -ARG MONO_VERSION=6.8.0.123 -RUN echo "deb http://download.mono-project.com/repo/debian stable-stretch/snapshots/$MONO_VERSION main" > /etc/apt/sources.list.d/mono-official-vs.list - -RUN apt-get update \ + && apt-get install -y --no-install-recommends apt-transport-https dirmngr gnupg ca-certificates \ + && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \ + && echo "deb https://download.mono-project.com/repo/debian stable-buster main" > /etc/apt/sources.list.d/mono-official-stable.list \ + && apt-get update \ && apt-get install -y wget xz-utils build-essential libtool-bin cmake git curl vim powercap-utils \ - libgmp-dev libssl-dev libssl1.1 libxml2 lbzip2 libtinfo5 libtool zlib1g libicu63 \ + libgmp-dev libssl-dev libssl1.1 libxml2 lbzip2 libtinfo5 libtool zlib1g \ libpcre3-dev libevent-dev libboost-dev libjson-c-dev libblas-dev liblapack-dev libopenblas-dev \ libjq-dev libonig-dev \ python3-numpy python3 python3-ujson python3-pip \ mono-devel nuget \ chezscheme gcc-10 gccgo-10 gdc-10 valac cpanminus \ - luajit lua5.3 lua-socket lua-posix \ - tcl tcllib php elixir clang-10 opam \ - && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10 \ + luajit lua5.4 liblua5.4-dev libluajit-5.1-dev \ + tcl tcllib php elixir clang-10 opam + +RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10 \ && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10 \ && update-alternatives --install /usr/bin/gdc gdc /usr/bin/gdc-10 10 \ && update-alternatives --install /usr/bin/gccgo gccgo /usr/bin/gccgo-10 10 \ - && update-alternatives --install /usr/bin/clang clang /usr/bin/clang-10 10 \ - && rm -rf /var/lib/apt/lists/* /tmp/* + && update-alternatives --install /usr/bin/clang clang /usr/bin/clang-10 10 \ + && rm -rf /var/lib/apt/lists/* /tmp/* # Requires for https://crates.io/crates/jq-sys in Debian ENV JQ_LIB_DIR=/usr/lib/x86_64-linux-gnu/ @@ -58,9 +49,9 @@ RUN export VERSION=ruby-2.7.1 \ ENV PATH="/opt/ruby/bin:${PATH}" # https://github.com/dotnet/core/tree/master/release-notes -ARG DOTNET_CORE=3.1.105 +ARG DOTNET_CORE=3.1.106 RUN mkdir dotnet && wget --progress=dot:giga -O - \ - https://download.visualstudio.microsoft.com/download/pr/37268c18-226d-436b-b13c-4b77b7f42140/17e8a85360206006a557d634d16713cd/dotnet-sdk-$DOTNET_CORE-linux-x64.tar.gz \ + https://download.visualstudio.microsoft.com/download/pr/03bf81cd-0275-4998-8a24-dc359fc5fed3/7450f821f9cd33c205378e1a0a5b2cb2/dotnet-sdk-$DOTNET_CORE-linux-x64.tar.gz \ | tar -xz -C dotnet ENV PATH="/opt/dotnet:${PATH}" ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 @@ -73,35 +64,35 @@ RUN wget --progress=dot:giga -O - \ ENV PATH="/opt/$PYPY/bin:${PATH}" # https://www.scala-lang.org/download/ -ARG SCALA=2.13.2 +ARG SCALA=2.13.3 RUN wget --progress=dot:giga -O - \ https://downloads.lightbend.com/scala/$SCALA/scala-$SCALA.tgz \ | tar -xz ENV PATH="/opt/scala-$SCALA/bin/:${PATH}" # https://jdk.java.net/ -ARG JDK=14.0.1 +ARG JDK=14.0.2 RUN wget --progress=dot:giga -O - \ - https://download.java.net/java/GA/jdk${JDK}/664493ef4a6946b186ff29eb326336a2/7/GPL/openjdk-${JDK}_linux-x64_bin.tar.gz \ + https://download.java.net/java/GA/jdk${JDK}/205943a0976c4ed48cb16f1043c5c647/12/GPL/openjdk-${JDK}_linux-x64_bin.tar.gz \ | tar -xz ENV PATH="/opt/jdk-$JDK/bin:${PATH}" # https://github.com/crystal-lang/crystal/releases -ARG CRYSTAL=crystal-0.35.0-1 +ARG CRYSTAL=crystal-0.35.1-1 RUN wget --progress=dot:giga -O - \ - https://github.com/crystal-lang/crystal/releases/download/0.35.0/$CRYSTAL-linux-x86_64.tar.gz \ + https://github.com/crystal-lang/crystal/releases/download/0.35.1/$CRYSTAL-linux-x86_64.tar.gz \ | tar -xz ENV PATH="/opt/$CRYSTAL/bin:${PATH}" # https://github.com/ldc-developers/ldc/releases -ARG LDC=ldc2-1.21.0-linux-x86_64 +ARG LDC=ldc2-1.22.0-linux-x86_64 RUN wget --progress=dot:giga -O - \ - https://github.com/ldc-developers/ldc/releases/download/v1.21.0/$LDC.tar.xz \ + https://github.com/ldc-developers/ldc/releases/download/v1.22.0/$LDC.tar.xz \ | tar -xJ ENV PATH="/opt/$LDC/bin/:${PATH}" # https://nim-lang.org/install_unix.html -ARG NIM=nim-1.2.0 +ARG NIM=nim-1.2.4 RUN wget --progress=dot:giga -O - \ https://nim-lang.org/download/$NIM-linux_x64.tar.xz \ | tar -xJ @@ -109,19 +100,19 @@ ENV PATH="/opt/$NIM/bin/:${PATH}" # https://dlang.org/download.html RUN wget --progress=dot:giga -O - \ - http://downloads.dlang.org/releases/2.x/2.092.1/dmd.2.092.1.linux.tar.xz \ + http://downloads.dlang.org/releases/2.x/2.093.0/dmd.2.093.0.linux.tar.xz \ | tar -xJ ENV PATH="/opt/dmd2/linux/bin64/:${PATH}" # https://nodejs.org/en/download/current/ -ARG NODE=v14.4.0 +ARG NODE=v14.5.0 RUN wget --progress=dot:giga -O - \ https://nodejs.org/dist/$NODE/node-$NODE-linux-x64.tar.xz \ | tar -xJ ENV PATH="/opt/node-$NODE-linux-x64/bin/:${PATH}" # https://www.jruby.org/download -ARG JRUBY=9.2.11.1 +ARG JRUBY=9.2.12.0 RUN wget --progress=dot:giga -O - \ https://repo1.maven.org/maven2/org/jruby/jruby-dist/$JRUBY/jruby-dist-$JRUBY-bin.tar.gz \ | tar -xz \ @@ -129,7 +120,7 @@ RUN wget --progress=dot:giga -O - \ # https://golang.org/dl/ RUN wget --progress=dot:giga -O - \ - https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz \ + https://golang.org/dl/go1.14.6.linux-amd64.tar.gz \ | tar -xz ENV PATH="/opt/go/bin/:${PATH}" @@ -176,7 +167,7 @@ ENV PATH="/opt/.ghcup/bin/:${PATH}" # https://www.haskell.org/ghc/ ARG GHC_VER=8.10.1 -RUN ghcup install $GHC_VER && ghcup set $GHC_VER +RUN ghcup install ghc $GHC_VER && ghcup set ghc $GHC_VER # Shared packages for all Haskell code RUN cabal update && cabal install network-simple --lib @@ -208,6 +199,18 @@ RUN git clone https://github.com/vlang/v.git /opt/v \ && make -j ENV PATH="/opt/v/:${PATH}" +# https://github.com/luarocks/luarocks/wiki/Download +ARG LUAROCKS=3.3.1 +RUN wget --progress=dot:giga -O - \ + http://luarocks.org/releases/luarocks-$LUAROCKS.tar.gz \ + | tar -xz \ + && cd luarocks-$LUAROCKS \ + && ./configure --prefix=/opt/luarocks/lua \ + && make -j && make install \ + && ./configure --with-lua-interpreter=luajit --prefix=/opt/luarocks/luajit \ + && make -j && make install \ + && cd .. && rm -rf luarocks-$LUAROCKS + ARG SCRIPTS_VER=unknown COPY *.rb ./ diff --git a/json/json.rs/Cargo.lock b/json/json.rs/Cargo.lock index 79d04ea4..5a53f267 100644 --- a/json/json.rs/Cargo.lock +++ b/json/json.rs/Cargo.lock @@ -2,7 +2,7 @@ # It is not intended for manual editing. [[package]] name = "itoa" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -18,7 +18,7 @@ name = "jq-sys" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -26,87 +26,87 @@ name = "json-rs" version = "0.0.1" dependencies = [ "jq-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.111 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.111 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.55 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.114 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.114 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.56 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "pkg-config" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "proc-macro2" -version = "1.0.10" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "quote" -version = "1.0.3" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ryu" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.111" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde_derive" -version = "1.0.111" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.34 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_json" -version = "1.0.55" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "ryu 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.111 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.114 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "syn" -version = "1.0.18" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "unicode-xid" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" [metadata] -"checksum itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" +"checksum itoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" "checksum jq-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c9cfaeae42ef96b227ab787558cc7bbd5f1dfe96b4df7c63f92853017751b0e4" "checksum jq-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "81b65b7e54bd2fffc8cb20cbcf19f40d3158dab5cf5b5adb1f65f9b35eba4c48" -"checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" -"checksum proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "df246d292ff63439fea9bc8c0a270bed0e390d5ebd4db4ba15aba81111b5abe3" -"checksum quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" -"checksum ryu 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ed3d612bc64430efeb3f7ee6ef26d590dce0c43249217bddc62112540c7941e1" -"checksum serde 1.0.111 (registry+https://github.com/rust-lang/crates.io-index)" = "c9124df5b40cbd380080b2cc6ab894c040a3070d995f5c9dc77e18c34a8ae37d" -"checksum serde_derive 1.0.111 (registry+https://github.com/rust-lang/crates.io-index)" = "3f2c3ac8e6ca1e9c80b8be1023940162bf81ae3cffbb1809474152f2ce1eb250" -"checksum serde_json 1.0.55 (registry+https://github.com/rust-lang/crates.io-index)" = "ec2c5d7e739bc07a3e73381a39d61fdb5f671c60c1df26a130690665803d8226" -"checksum syn 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "410a7488c0a728c7ceb4ad59b9567eb4053d02e8cc7f5c0e0eeeb39518369213" -"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +"checksum pkg-config 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)" = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" +"checksum proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa" +"checksum quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +"checksum ryu 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +"checksum serde 1.0.114 (registry+https://github.com/rust-lang/crates.io-index)" = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" +"checksum serde_derive 1.0.114 (registry+https://github.com/rust-lang/crates.io-index)" = "2a0be94b04690fbaed37cddffc5c134bf537c8e3329d53e982fe04c374978f8e" +"checksum serde_json 1.0.56 (registry+https://github.com/rust-lang/crates.io-index)" = "3433e879a558dde8b5e8feb2a04899cf34fdde1fafb894687e52105fc1162ac3" +"checksum syn 1.0.34 (registry+https://github.com/rust-lang/crates.io-index)" = "936cae2873c940d92e697597c5eee105fb570cd5689c695806f672883653349b" +"checksum unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" diff --git a/json/json.rs/Cargo.toml b/json/json.rs/Cargo.toml index 4baaf287..d8ab657a 100644 --- a/json/json.rs/Cargo.toml +++ b/json/json.rs/Cargo.toml @@ -4,9 +4,9 @@ version = "0.0.1" edition = "2018" [dependencies] -serde = "1.0.111" -serde_derive = "1.0.111" -serde_json = "1.0.55" +serde = "1.0.114" +serde_derive = "1.0.114" +serde_json = "1.0.56" jq-rs = "0.4.1" [profile.release] diff --git a/json/test-xs.pl b/json/test-xs.pl index 4946009b..0257640a 100644 --- a/json/test-xs.pl +++ b/json/test-xs.pl @@ -1,5 +1,8 @@ -use strict; +use v5.12; use warnings; +use feature qw(signatures); +no warnings qw(experimental::signatures); + use File::Slurper 'read_binary'; use Cpanel::JSON::XS 'decode_json'; use Socket; @@ -9,8 +12,7 @@ struct(Coordinate => [x => '$', y => '$', z => '$']); -sub notify { - my $msg = shift; +sub notify ($msg) { socket(my $socket, Socket::PF_INET, Socket::SOCK_STREAM, (getprotobyname('tcp'))[2]); if (connect($socket, Socket::pack_sockaddr_in(9001, Socket::inet_aton('localhost')))) { print $socket $msg; @@ -18,8 +20,7 @@ sub notify { close($socket); } -sub calc { - my $bytes = shift; +sub calc ($bytes) { my $jobj = decode_json $bytes; my $coordinates = $jobj->{coordinates}; my $len = @$coordinates; diff --git a/json/test.pl b/json/test.pl index 34c0e89f..68c56ef7 100644 --- a/json/test.pl +++ b/json/test.pl @@ -1,5 +1,8 @@ -use strict; +use v5.12; use warnings; +use feature qw(signatures); +no warnings qw(experimental::signatures); + use File::Slurper 'read_binary'; use JSON::Tiny 'decode_json'; use Socket; @@ -9,8 +12,7 @@ struct(Coordinate => [x => '$', y => '$', z => '$']); -sub notify { - my $msg = shift; +sub notify ($msg) { socket(my $socket, Socket::PF_INET, Socket::SOCK_STREAM, (getprotobyname('tcp'))[2]); if (connect($socket, Socket::pack_sockaddr_in(9001, Socket::inet_aton('localhost')))) { print $socket $msg; @@ -18,8 +20,7 @@ sub notify { close($socket); } -sub calc { - my $bytes = shift; +sub calc ($bytes) { my $jobj = decode_json $bytes; my $coordinates = $jobj->{coordinates}; my $len = @$coordinates; diff --git a/json/test.v b/json/test.v index dc213cb5..7aae4008 100644 --- a/json/test.v +++ b/json/test.v @@ -20,10 +20,8 @@ fn notify(msg string) { sock := net.dial('127.0.0.1', 9001) or { return } - sock.write(msg) or { - } - sock.close() or { - } + sock.write(msg) or { } + sock.close() or { } } fn calc(s string) Coordinate { @@ -59,7 +57,7 @@ fn main() { $if clang { lang = 'V Clang' } - notify('${lang}\t${C.getpid()}') + notify('$lang\t$C.getpid()') println(calc(s)) notify('stop') } diff --git a/matmul/matmul.pl b/matmul/matmul.pl index 50a9394a..68a975df 100644 --- a/matmul/matmul.pl +++ b/matmul/matmul.pl @@ -1,8 +1,12 @@ # rurban; distributed under the MIT license +use v5.12; +use warnings; +use feature qw(signatures); +no warnings qw(experimental::signatures); + use Socket; -sub matmul { - my ($a, $b) = @_; +sub matmul ($a, $b) { my $m = $#{$a} - 1; my $n = $#{$a->[0]} - 1; my $p = $#{$b->[0]} - 1; @@ -30,8 +34,7 @@ sub matmul { \@c } -sub matgen { - my ($n, $seed) = @_; +sub matgen ($n, $seed) { my $tmp = $seed / $n / $n; my @a; for my $i (0..$n) { @@ -42,8 +45,7 @@ sub matgen { \@a } -sub notify { - my $msg = shift; +sub notify ($msg) { socket(my $socket, Socket::PF_INET, Socket::SOCK_STREAM, (getprotobyname('tcp'))[2]); if (connect($socket, Socket::pack_sockaddr_in(9001, Socket::inet_aton('localhost')))) { print $socket $msg; @@ -51,8 +53,7 @@ sub notify { close($socket); } -sub calc { - my $n = shift; +sub calc ($n) { $n = int($n / 2) * 2; my $a = matgen($n, 1.0); my $b = matgen($n, 2.0); diff --git a/matmul/matmul.v b/matmul/matmul.v index 837b0f07..20c6bf69 100644 --- a/matmul/matmul.v +++ b/matmul/matmul.v @@ -53,10 +53,8 @@ fn notify(msg string) { sock := net.dial('127.0.0.1', 9001) or { return } - sock.write(msg) or { - } - sock.close() or { - } + sock.write(msg) or { } + sock.close() or { } } fn calc(n int) f64 { @@ -78,7 +76,7 @@ fn main() { $if clang { lang = 'V Clang' } - notify('${lang}\t${C.getpid()}') + notify('$lang\t$C.getpid()') println(calc(n)) notify('stop') }