Skip to content

Commit

Permalink
add Hyperfine script
Browse files Browse the repository at this point in the history
  • Loading branch information
efremropelato committed Nov 3, 2024
1 parent 84f8464 commit 3c86647
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ E' possibile eseguire tutti gli script in seguenza, tramite lo script `run.sh <n
``` ```
```

#### Hyperfine

Per eseguire `./hyperfine.sh`, si deve installare il binario: [Hyperfine installation](https://github.com/sharkdp/hyperfine/tree/master?tab=readme-ov-file#installation)

### Risultati

Utilizzando un **Intel® Core™ i5-6500 e 32Gb** i risultati, misurati in secondi, sono:
Expand Down
8 changes: 8 additions & 0 deletions banchmark.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|:---|---:|---:|---:|---:|
| `python3 ./PY/main.py` | 202.0 ± 4.7 | 195.8 | 210.1 | 9.42 ± 0.61 |
| `ruby ./RB/main.rb` | 3594.9 ± 72.1 | 3509.7 | 3721.5 | 167.74 ± 10.60 |
| `node ./JS/index.js` | 80.5 ± 13.1 | 69.7 | 113.4 | 3.76 ± 0.65 |
| `./GO/main` | 27.8 ± 0.7 | 26.2 | 28.4 | 1.30 ± 0.08 |
| `./RS/target/release/main ` | 21.4 ± 1.3 | 19.6 | 23.7 | 1.00 |
| `cd JV && java Main && cd ..` | 150.2 ± 5.0 | 145.1 | 161.7 | 7.01 ± 0.48 |
27 changes: 27 additions & 0 deletions hyperfine.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#! /bin/bash

export PI_SIMULATIONS=$1 &&\
hyperfine --shell zsh --warmup 5 --runs 10 \
--setup "" \
--cleanup "" \
--prepare "go build -o ./GO/main ./GO/main.g && cd RS && cargo build --release -q && cd .. && cd JV && javac ./Main.java && cd .. || true" \
"python3 ./PY/main.py" \
"ruby ./RB/main.rb" \
"node ./JS/index.js" \
"./GO/main" \
"./RS/target/release/main " \
"cd JV && java Main && cd .." \
--export-markdown ./banchmark.md
# -- --conclude "cd .." \
# --prepare "cd JV && javac ./Main.java" \
# "java Main" \
# -- --conclude "cd .." \


# go build -o ./GO/main ./GO/main.go && \
# ./GO/main && \
# cd RS && cargo build --release -q && cd .. && \
# ./RS/target/release/main && \
# cd JV && javac ./Main.java && \
# java Main && \
# cd ..

0 comments on commit 3c86647

Please sign in to comment.