diff --git a/README.md b/README.md index d2d4cfd..add90b1 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,27 @@ Note: clang is a bit better in this case. [see source](cpp) +### Crystal + +* Crystal 1.5.0 (2022-07-21); LLVM: 14.0.6; Default target: x86_64-pc-linux-gnu +* Benchmark date: 2022-07-30 [yyyy-mm-dd] + +| Compilation | Runtime (sec) | EXE (bytes) | stripped EXE (bytes) | +|-----|:---:|:---:|:---:| +| `crystal build --release main.cr` | 3.624 ± 0.01 | 626,368 | 215,968 | + +Notes: + +* The runtime is excellent, comparable to C. +* The source code is almost identical to the Ruby source code. +* The build time in release mode is very slow. It was 12.8 seconds +on my machine. + +See https://crystal-lang.org for more info about this language. + +[see source](crystal) + + ### D * DMD64 D Compiler v2.100.0 diff --git a/_automation/crystal.json b/_automation/crystal.json new file mode 100644 index 0000000..719eab7 --- /dev/null +++ b/_automation/crystal.json @@ -0,0 +1,11 @@ +{ + "section_name": "Crystal", + "compilers": ["crystal"], + "output_file": "main", + "table_headers": [ + "Compilation", + "Runtime (sec)", + "EXE (bytes)", + "stripped EXE (bytes)" + ] +} diff --git a/_automation/lib/version.py b/_automation/lib/version.py index afe03db..f1345c1 100644 --- a/_automation/lib/version.py +++ b/_automation/lib/version.py @@ -22,7 +22,7 @@ def get_version_string(name): if name in ("lua", "luajit", "fpc"): cmd = f"{name} -v" return get_simple_cmd_output_lines(cmd)[0] - if name == "elixir": + if name in ("elixir", "crystal"): cmd = f"{name} -v" text = "; ".join([line for line in get_simple_cmd_output_lines(cmd) if line]) return text diff --git a/crystal/Makefile b/crystal/Makefile index 2e54eef..4023c16 100644 --- a/crystal/Makefile +++ b/crystal/Makefile @@ -1,2 +1,8 @@ -build: +v1: crystal build --release main.cr + +strip: + strip -s main + +clean: + rm main