2
2
3
3
Benchmark for interpreted languages.
4
4
5
+ ![ Barchart for relative execution speed] ( shebang-scripts/today/chart.svg )
6
+
7
+ The values for Rust, V, and Haskell are not really representative
8
+ as they are compiled on the first run
9
+ and Haskell unfortunately does not even cache the compiled binary.
10
+
5
11
6
12
## Languages
7
13
14
+ - [ Bash]
15
+ - [ Bun]
16
+ - [ Dart]
17
+ - [ Dash]
18
+ - [ Elixir]
19
+ - [ Elvish]
20
+ - [ F#]
21
+ - [ Fish]
22
+ - [ Guile]
23
+ - [ Haskell]
8
24
- JavaScript via
9
25
- [ Node.js]
10
26
- [ Deno]
11
27
- [ Bun]
28
+ - [ Julia]
29
+ - [ Ksh]
30
+ - [ Lua]
31
+ - [ Lua]
32
+ - [ Nickel]
33
+ - [ Nix Language]
34
+ - [ Nushell]
35
+ - [ OCaml]
36
+ - [ Osh]
37
+ - [ Perl]
38
+ - [ PHP]
12
39
- TypeScript via
13
40
- [ Deno]
14
41
- [ Bun]
15
42
- [ Python]
16
- - [ Lua]
17
- - [ Nickel]
18
- - [ Nix Language]
43
+ - [ Python]
44
+ - [ Racket]
45
+ - [ Roc.roc]
46
+ - [ Ruby]
47
+ - [ Scala]
48
+ - [ Swift]
19
49
- [ Typst]
50
+ - [ V]
20
51
52
+ [ Bash ] : https://www.gnu.org/software/bash/
21
53
[ Bun ] : https://bun.sh/
54
+ [ Dart ] : https://dart.dev/
55
+ [ Dash ] : https://wiki.archlinux.org/title/Dash
22
56
[ Deno ] : https://deno.com/
57
+ [ Elixir ] : https://elixir-lang.org/
58
+ [ Elvish ] : https://elv.sh/
59
+ [ F# ] : https://fsharp.org/
60
+ [ Fish ] : https://fishshell.com/
61
+ [ Guile ] : https://www.gnu.org/software/guile/
62
+ [ Haskell ] : https://www.haskell.org/
63
+ [ Julia ] : https://julialang.org/
64
+ [ Ksh ] : https://www.kornshell.com/
23
65
[ Lua ] : https://www.lua.org/
24
66
[ Nickel ] : https://nickel-lang.org/
25
67
[ Nix Language ] : https://nixos.org/manual/nix/stable/language/
26
68
[ Node.js ] : https://nodejs.org/
69
+ [ Nushell ] : https://www.nushell.sh/
70
+ [ OCaml ] : https://ocaml.org/
71
+ [ Osh ] : https://www.oilshell.org/
72
+ [ Perl ] : https://www.perl.org/
73
+ [ PHP ] : https://www.php.net/
27
74
[ Python ] : https://www.python.org/
75
+ [ Racket ] : https://racket-lang.org/
76
+ [ Roc.roc ] : https://roc-lang.org/
77
+ [ Ruby ] : https://www.ruby-lang.org/
78
+ [ Scala ] : https://www.scala-lang.org/
79
+ [ Swift ] : https://swift.org/
28
80
[ Typst ] : https://typst.app/docs/
81
+ [ V ] : https://vlang.io/
29
82
30
83
31
84
### Workarounds
@@ -37,86 +90,67 @@ Benchmark for interpreted languages.
37
90
38
91
## Result
39
92
40
- ### MacBook Pro 14"
93
+ Check out the workflow runs for the latest benchmark results.
41
94
42
- ``` yaml
43
- Year : 2021
44
- Chip : Apple M1 Pro
45
- Memory : 16 GB
46
- macOS : 13.6.2
47
- ` ` `
48
95
49
- On 2024-01-29:
96
+ ### GitHub's MacOS 14 Runner
97
+
98
+ #### Bucket Calc
50
99
51
100
``` txt
52
- nickel-lang-cli nickel 1.3.0 (rev Homebre)
53
- Python 3.11.6
54
- Lua 5.4.6 Copyright (C) 1994-2023 Lua.org, PUC-Rio
55
- deno 1.39.1 (release, aarch64-apple-darwin)
56
- v8 12.0.267.8
57
- typescript 5.3.3
58
- bun --version
59
- 1.0.20
60
- node --version
61
- v20.7.0
62
- hyperfine 1.18.0
63
-
64
- ===== Running Benchmark =====
65
-
66
- Summary
67
- lua bin-calculation.lua ran
68
- 4.71 ± 0.39 times faster than nickel export bin-calculation.ncl
69
- 5.89 ± 0.50 times faster than bun run bin-calculation.js
70
- 6.00 ± 0.51 times faster than bun run bin-calculation.ts
71
- 11.09 ± 1.11 times faster than python3 bin-calculation.py
72
- 11.82 ± 0.92 times faster than deno run bin-calculation.ts
73
- 11.86 ± 1.07 times faster than deno run bin-calculation.js
74
- 17.90 ± 1.33 times faster than node bin-calculation.js
101
+ lua bucket-calc/main.lua ran
102
+ 2.96 ± 3.97 times faster than nickel export bucket-calc/main.ncl
103
+ 3.05 ± 3.98 times faster than bun run bucket-calc/main.js
104
+ 3.09 ± 4.07 times faster than bun run bucket-calc/main.ts
105
+ 4.71 ± 5.77 times faster than python3 bucket-calc/main.py
106
+ 4.76 ± 5.83 times faster than deno run bucket-calc/main.ts
107
+ 4.80 ± 5.91 times faster than deno run bucket-calc/main.js
108
+ 8.56 ± 10.56 times faster than node bucket-calc/main.js
109
+ 24.21 ± 29.52 times faster than
110
+ typst query --field=text --one bucket-calc/main.typ
75
111
```
76
112
77
113
78
- ### Mac mini
79
-
80
- ``` yaml
81
- Year : 2018
82
- Processor : 3.2 GHz 6-Core Intel Core i7
83
- Memory : 32 GB 2667 MHz DDR4
84
- macOS : 13.6.3
85
- ` ` `
86
-
87
- On 2024-01-29:
114
+ #### Shebang Scripts
88
115
89
116
``` txt
90
- nickel-lang-cli nickel 1.4.0 (rev Homebre)
91
- Python 3.11.7
92
- Lua 5.4.6 Copyright (C) 1994-2023 Lua.org, PUC-Rio
93
- deno 1.39.4 (release, x86_64-apple-darwin)
94
- v8 12.0.267.8
95
- typescript 5.3.3
96
- bun --version
97
- 1.0.23
98
- node --version
99
- v20.10.0
100
- hyperfine 1.18.0
101
-
102
- ===== Running Benchmark =====
103
-
104
- Summary
105
- lua bin-calculation.lua ran
106
- 4.09 ± 0.52 times faster than nickel export bin-calculation.ncl
107
- 4.70 ± 0.54 times faster than bun run bin-calculation.ts
108
- 4.93 ± 0.75 times faster than bun run bin-calculation.js
109
- 8.36 ± 1.00 times faster than python3 bin-calculation.py
110
- 8.83 ± 1.21 times faster than deno run bin-calculation.js
111
- 8.85 ± 1.05 times faster than deno run bin-calculation.ts
112
- 11.39 ± 1.33 times faster than node bin-calculation.js
117
+ ./luajit ran
118
+ 1.06 ± 0.22 times faster than ./lua
119
+ 1.61 ± 0.27 times faster than ./bash
120
+ 1.62 ± 0.29 times faster than ./dash
121
+ 2.12 ± 0.49 times faster than ./ksh
122
+ 2.66 ± 0.55 times faster than ./osh
123
+ 3.77 ± 0.63 times faster than ./elvish
124
+ 3.91 ± 0.67 times faster than ./v.vsh
125
+ 4.92 ± 0.82 times faster than ./fish
126
+ 6.16 ± 1.02 times faster than ./bun
127
+ 9.65 ± 1.72 times faster than ./guile
128
+ 13.94 ± 2.29 times faster than ./python
129
+ 14.20 ± 2.39 times faster than ./nushell
130
+ 17.43 ± 2.86 times faster than ./php
131
+ 23.01 ± 3.94 times faster than ./ocaml
132
+ 35.43 ± 5.99 times faster than ./ruby
133
+ 52.94 ± 9.08 times faster than ./racket
134
+ 56.77 ± 9.59 times faster than ./perl
135
+ 89.13 ± 14.62 times faster than ./dart
136
+ 106.23 ± 18.77 times faster than ./swift
137
+ 143.96 ± 24.03 times faster than ./julia
138
+ 199.84 ± 33.40 times faster than ./roc.roc
139
+ 224.83 ± 47.56 times faster than ./elixir
140
+ 483.43 ± 87.95 times faster than ./haskell
141
+ 507.16 ± 114.14 times faster than ./scala
142
+ 528.19 ± 94.47 times faster than ./fsharp.fsx
113
143
```
114
144
115
145
116
146
## Related
117
147
118
148
- [ jinyus/related_post_gen] - Data Processing benchmark
149
+ - [ plb2] - A programming language benchmark
150
+ - [ Programming-Language-Benchmarks] [ PLB ]
119
151
- [ script-bench-rs] - Rust embedded scripting languages benchmark
120
152
121
153
[ jinyus/related_post_gen ] : https://github.com/jinyus/related_post_gen
154
+ [ PLB ] : https://github.com/hanabi1224/Programming-Language-Benchmarks
155
+ [ plb2 ] : https://github.com/attractivechaos/plb2
122
156
[ script-bench-rs ] : https://github.com/khvzak/script-bench-rs
0 commit comments