update time with -march=native flag

This commit is contained in:
NunoSempere 2024-02-11 19:24:00 +01:00
parent dd7c42d952
commit 54bd358f7e
2 changed files with 45 additions and 46 deletions

View File

@ -24,17 +24,17 @@ The name of this repository is a pun on two meanings of "time to": "how much tim
| Language | Time | Lines of code | | Language | Time | Lines of code |
|-----------------------------|-----------|---------------| |-----------------------------|-----------|---------------|
| C | 5.6ms | 252 | | C | 6.20ms | 252 |
| squiggle.c | 8.2ms | 29* | | squiggle.c | 7.20ms | 29* |
| Nim | 40.8ms | 84 | | Nim | 41.10ms | 84 |
| Lua (LuaJIT) | 69.9ms | 82 | | Lua (LuaJIT) | 68.80ms | 82 |
| OCaml (flambda) | 187.9ms | 123 | | OCaml (flambda) | 185.50ms | 123 |
| Squiggle (bun) | 0.387s | 14* | | Squiggle (bun) | 384.00ms | 14* |
| Javascript (node) | 0.445s | 69 | | Javascript (node) | 0.423s | 69 |
| SquigglePy (v0.27) | 1.507s | 18* | | SquigglePy (v0.27) | 1.542s | 18* |
| R (3.6.1) | 4.508s | 49 | | R (3.6.1) | 4.494s | 49 |
| Python 3.9 | 11.879s | 56 | | Python 3.9 | 11.909s | 56 |
| Gavin Howard's bc | 15.960s | 101 | | Gavin Howard's bc | 16.170s | 101 |
Time measurements taken with the [time](https://man7.org/linux/man-pages/man1/time.1.html) tool, using 1M samples. But different implementations use different algorithms and, occasionally, different time measuring methodologies (for the C, Nim and Lua implementations, I run the program 100 times and take the mean). Their speed was also measured under different loads in my machine. So I think that these time estimates are accurate within maybe ~2x or so. Time measurements taken with the [time](https://man7.org/linux/man-pages/man1/time.1.html) tool, using 1M samples. But different implementations use different algorithms and, occasionally, different time measuring methodologies (for the C, Nim and Lua implementations, I run the program 100 times and take the mean). Their speed was also measured under different loads in my machine. So I think that these time estimates are accurate within maybe ~2x or so.

View File

@ -1,96 +1,95 @@
# bc # bc
time ghbc -l squiggle.bc estimate.bc time ghbc -l squiggle.bc estimate.bc
.8907201178102747 .8872657001481914
real 0m15.960s real 0m16.170s
user 0m15.948s user 0m16.115s
sys 0m0.000s sys 0m0.008s
# C # C
Running 100x and taking avg time: OMP_NUM_THREADS=16 out/samples Running 100x and taking avg time: OMP_NUM_THREADS=16 out/samples
Time using 16 threads: 5.60ms Time using 16 threads: 6.20ms
# js (bun) # js (bun)
0.8867426270252042 0.8861715640546732
real 0m0.551s real 0m0.562s
user 0m0.527s user 0m0.540s
sys 0m0.055s sys 0m0.074s
# js (node) # js (node)
0.8878977218582866 0.8863245179136781
real 0m0.445s real 0m0.423s
user 0m0.523s user 0m0.509s
sys 0m0.060s sys 0m0.077s
# lua (luajit) # lua (luajit)
Requires /bin/time, found on GNU/Linux systems Requires /bin/time, found on GNU/Linux systems
Running 100x and taking avg time of: luajit samples.lua Running 100x and taking avg time of: luajit samples.lua
Time: 69.90ms Time: 68.80ms
# nim # nim
Requires /bin/time, found on GNU/Linux systems Requires /bin/time, found on GNU/Linux systems
Running 100x and taking avg time of: Running 100x and taking avg time of:
Time: 40.80ms Time: 41.10ms
# ocaml # ocaml
Requires /bin/time, found on GNU/Linux systems Requires /bin/time, found on GNU/Linux systems
Running 100x and taking avg time of: Running 100x and taking avg time of:
Time: 187.90ms Time: 185.50ms
# Python (3.9) # Python (3.9)
0.8887373869178242 0.8887373869178242
real 0m11.879s real 0m11.909s
user 0m12.129s user 0m12.149s
sys 0m1.055s sys 0m1.145s
# R (3.6.1) # R (3.6.1)
[1] 0.8899922 [1] 0.8862725
real 0m4.508s real 0m4.494s
user 0m4.476s user 0m4.465s
sys 0m0.028s sys 0m0.025s
# Squiggle (0.8.6) # Squiggle (0.8.6)
Requires /bin/time, found on GNU/Linux systems Requires /bin/time, found on GNU/Linux systems
Running 100x and taking avg time of: Running 100x and taking avg time of:
Time: 386.80ms Time: 384.00ms
# SquigglePy (0.27) # SquigglePy (0.27)
time python3.9 samples.py time python3.9 samples.py
0%| | 0/4 [00:00<?, ?it/s] 75%|███████▌ | 3/4 [00:00<00:00, 27.07it/s] 100%|██████████| 4/4 [00:00<00:00, 23.38it/s] 100%|█████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 22.58it/s]
0%| | 0/1000000 [00:00<?, ?it/s] 10%|█ | 104035/1000000 [00:00<00:00, 1040346.03it/s] 24%|██▍ | 238684/1000000 [00:00<00:00, 1220429.41it/s] 38%|███▊ | 376402/1000000 [00:00<00:00, 1292004.08it/s] 51%|█████▏ | 514235/1000000 [00:00<00:00, 1326083.80it/s] 65%|██████▌ | 654235/1000000 [00:00<00:00, 1352735.46it/s] 80%|███████▉ | 795746/1000000 [00:00<00:00, 1373942.14it/s] 93%|█████████▎| 934912/1000000 [00:00<00:00, 1379731.72it/s] it/s] it/s]
0.8879525229675179 0.8876134007583529
real 0m1.507s real 0m1.542s
user 0m1.969s user 0m1.989s
sys 0m2.201s sys 0m2.226s
# squiggle.c # squiggle.c
Running 100x and taking avg time: OMP_NUM_THREADS=16 ./samples Running 100x and taking avg time: OMP_NUM_THREADS=16 ./samples
Time using 16 threads: 12.70ms Time using 16 threads: 7.20ms