update README

This commit is contained in:
NunoSempere 2023-10-15 02:29:29 +01:00
parent 50fb88db7c
commit c19738709a
2 changed files with 12 additions and 8 deletions

View File

@ -25,10 +25,10 @@ The name of this repository is a pun on two meanings of "time to": "how much tim
| Language | Time | Lines of code |
|-----------------------------|-----------|---------------|
| C (optimized, 16 threads) | 5ms | 249 |
| squiggle.c | 37ms | 54 |
| squiggle.c | 37ms | 54* |
| Nim | 38ms | 84 |
| Lua (LuaJIT) | 68ms | 82 |
| OCaml (flambda mode) | 245ms | 112 |
| OCaml (flambda) | 164ms | 123 |
| Lua | 278ms | 82 |
| C (naïve implementation) | 292ms | 149 |
| Javascript (NodeJS) | 732ms | 69 |
@ -119,6 +119,10 @@ sudo ln -sf luajit-2.1.0-beta3 /usr/local/bin/luajit
Overall I'm thinking that a combination of lua at least for scripting and ¿nim/C/tbd? for more serious programs could be quite powerful.
### OCaml
OCaml was like meeting an old and forgotten friend. I found its syntax a bit clunky, but could get accustomed to it. Its list matching is nice, O(n) list element accessing, not so much. Honestly, I wanted to really like it, but I'm not sure yet. And it's *slow* compared to C.
### Overall thoughts
Overall I don't think that this is a fair comparison of the languages intrinsically, because I'm just differentially good at them, because I've chosen to put more effort in ones than in others. But it is still useful to me personally, and perhaps mildly informative to others.

View File

@ -140,12 +140,12 @@ Time using 1 thread: 37.60ms
## squiggle.ml
— make fast && make time
— make fast && time make run
ocamlopt -O3 -unsafe samples.ml -o ./out/samples
mv samples.cmi samples.cmx samples.o ./out/
bash -c "time ./out/samples"
Mean: 0.886498
./out/samples
Mean: 0.884629
real 0m0.245s
user 0m0.232s
sys 0m0.012s
real 0m0.164s
user 0m0.159s
sys 0m0.004s