release 0.1.0
This commit is contained in:
commit
30d94536a9
90 changed files with 7722 additions and 0 deletions
17
benchmarks/bench.ps1
Normal file
17
benchmarks/bench.ps1
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
$fileDirname = $PSScriptRoot
|
||||
$owaCmd = ".\target\release\owa-rs.exe"
|
||||
|
||||
for ($i = 1; $i -le 1; $i++) {
|
||||
$pythonFile = "$fileDirname/case$i/main.py"
|
||||
$owaFile = "$fileDirname/case$i/main.owa"
|
||||
$noOwuFile = "$fileDirname/case$i/no_owu.owa"
|
||||
Write-Host "Running case #$i"
|
||||
hyperfine `
|
||||
--warmup 5 `
|
||||
--min-runs 50 `
|
||||
--show-output `
|
||||
--export-markdown "$fileDirname/case$i/result.md" `
|
||||
"python3.14 $pythonFile" `
|
||||
"$owaCmd run $owaFile" `
|
||||
"$owaCmd --no-owu $noOwuFile"
|
||||
}
|
||||
18
benchmarks/bench.sh
Normal file
18
benchmarks/bench.sh
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env sh
|
||||
file_dirname="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
owa_cmd="./target/release/owa-rs"
|
||||
|
||||
for i in $(seq 1 1); do
|
||||
python_file="${file_dirname}/case${i}/main.py"
|
||||
owa_file="${file_dirname}/case${i}/main.owa"
|
||||
no_owu_file="${file_dirname}/case${i}/no_owu.owa"
|
||||
echo "Running case #${i}"
|
||||
hyperfine \
|
||||
--warmup 5 \
|
||||
--min-runs 50 \
|
||||
--show-output \
|
||||
--export-markdown "${file_dirname}/case${i}/result.md" \
|
||||
"python3 $python_file" \
|
||||
"$owa_cmd run $owa_file" \
|
||||
"$owa_cmd --no-owu $no_owu_file"
|
||||
done
|
||||
8
benchmarks/case1/main.owa
Normal file
8
benchmarks/case1/main.owa
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
(seq
|
||||
(def fib (lambda [n]
|
||||
(match n
|
||||
(0 0)
|
||||
(1 1)
|
||||
(_ (+ (this (- n 1)) (this (- n 2)))))))
|
||||
(trace (fib 12))
|
||||
)
|
||||
9
benchmarks/case1/main.py
Normal file
9
benchmarks/case1/main.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
def fib(n):
|
||||
if n == 0:
|
||||
return 0
|
||||
if n == 1:
|
||||
return 1
|
||||
return fib(n - 1) + fib(n - 2)
|
||||
|
||||
|
||||
print(fib(12))
|
||||
8
benchmarks/case1/no_owu.owa
Normal file
8
benchmarks/case1/no_owu.owa
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
(builtins.seq
|
||||
(builtins.def fib (builtins.lambda [n]
|
||||
(builtins.cond.match n
|
||||
(0 0)
|
||||
(1 1)
|
||||
(_ (builtins.math.add (this (builtins.math.sub n 1)) (this (builtins.math.sub n 2)))))))
|
||||
(builtins.trace (fib 12))
|
||||
)
|
||||
5
benchmarks/case1/result.md
Normal file
5
benchmarks/case1/result.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|
||||
|:---|---:|---:|---:|---:|
|
||||
| `python3.14 D:\Tools\Projects\owa-rs\benchmarks/case1/main.py` | 40.5 ± 0.7 | 39.5 | 43.1 | 2.38 ± 0.36 |
|
||||
| `.\target\release\owa-rs.exe run D:\Tools\Projects\owa-rs\benchmarks/case1/main.owa` | 53.3 ± 1.2 | 51.5 | 57.6 | 3.14 ± 0.48 |
|
||||
| `.\target\release\owa-rs.exe --no-owu D:\Tools\Projects\owa-rs\benchmarks/case1/no_owu.owa` | 17.0 ± 2.6 | 15.3 | 37.5 | 1.00 |
|
||||
Loading…
Add table
Add a link
Reference in a new issue