Files
print_hej/reports/1000_decimals_mermaid.md
T
Ein Anderssono 525b8a92f1 Replace PNG images with Mermaid.js diagrams
- Replaced all PNG visualizations with Mermaid.js diagrams
- Mermaid diagrams render directly in GitHub/GitLab
- Added 4 chart types per report:
  - Execution time comparison (bar chart)
  - Memory usage comparison (bar chart)
  - CPU efficiency/IPC comparison (bar chart)
  - Time vs memory trade-off (graph)
- All diagrams are interactive and can be viewed in any Markdown viewer
- Much better for version control and collaboration
2026-04-23 14:45:51 +02:00

113 lines
4.9 KiB
Markdown

# Performance Report: 1000 Decimals
## Test Environment
**Hardware:**
- **Model:** MacBook Neo (Mac17,5)
- **Processor:** Apple A18 Pro (6 cores: 2 performance + 4 efficiency)
- **Memory:** 8 GB RAM
- **Operating System:** macOS (Darwin)
**Methodology:**
- Each language runs 4 times per test
- First run is considered "warmup" and excluded
- Results are the average of the 3 subsequent runs
- Time measured in milliseconds (ms)
- Memory measured in bytes via RSS (Resident Set Size)
## Performance Summary
### All Languages
| Rank | Language | Time (ms) | Memory (bytes) | Instructions | Cycles | IPC | Type |
|------|-----------|-----------|----------------|--------------|---------|-----|------|
| 1 | Crystal | 22 | 3293184 | 29546282 | 9885445 | 2.98 | Compiled |
| 2 | D | 24 | 2479445 | 80920081 | 20218601 | 4.00 | Compiled |
| 3 | Zig | 25 | 2981888 | 63916095 | 24932859 | 2.56 | Compiled |
| 4 | C++ | 26 | 1523712 | 23545731 | 9050444 | 2.60 | Compiled |
| 5 | Fortran | 26 | 1802240 | 27378187 | 8787318 | 3.11 | Compiled |
| 6 | Nim | 27 | 1572864 | 15728237 | 5449577 | 2.88 | Compiled |
| 7 | Rust | 27 | 1687552 | 15233650 | 4898110 | 3.11 | Compiled |
| 8 | C | 27 | 1687552 | 14479010 | 6499773 | 2.22 | Compiled |
| 9 | Objective-C | 27 | 6045696 | 27238699 | 10593613 | 2.57 | Compiled |
| 10 | Lua | 29 | 2091690 | 17419324 | 8017680 | 2.17 | Interpreted |
| 11 | Swift | 30 | 6083925 | 50037590 | 16493503 | 3.03 | Compiled |
| 12 | Odin | 30 | 1731242 | 16241385 | 6689690 | 2.42 | Compiled |
| 13 | Go | 31 | 4041386 | 19473738 | 8671903 | 2.24 | Compiled |
| 14 | Assembly | 32 | 1409024 | 12558975 | 6069377 | 2.06 | Compiled |
| 15 | Bash | 34 | 2058922 | 18550685 | 8090090 | 2.29 | Interpreted |
| 16 | Dart | 35 | 14641834 | 63451402 | 27183385 | 2.33 | JIT |
| 17 | Haskell | 46 | 12053162 | 49928755 | 18118511 | 2.75 | Compiled |
| 18 | Brainfuck | 56 | 9185962 | 17501272 | 8126562 | 2.15 | Interpreted |
| 19 | Perl | 58 | 12506453 | 17355692 | 7662235 | 2.26 | Interpreted |
| 20 | Python | 60 | 9737557 | 17485978 | 7928968 | 2.20 | Interpreted |
| 21 | CSharp | 64 | 41462442 | 17452260 | 8624146 | 2.02 | JIT |
| 22 | Kotlin | 65 | 45208917 | 17527899 | 7459125 | 2.34 | JIT |
| 23 | Java | 68 | 43073536 | 17776760 | 8998434 | 1.97 | JIT |
| 24 | PHP | 95 | 26624000 | 17546554 | 7685481 | 2.28 | Interpreted |
| 25 | Ruby | 96 | 28934144 | 17400986 | 7174843 | 2.42 | Interpreted |
| 26 | JavaScript | 118 | 44417024 | 18142055 | 9003896 | 2.01 | Interpreted |
| 27 | Erlang | 185 | 77048490 | 17696158 | 7782102 | 2.27 | Interpreted |
| 28 | Julia | 190 | 236235434 | 17691121 | 7819185 | 2.26 | JIT |
| 29 | R | 220 | 91253418 | 18177908 | 8751540 | 2.07 | Interpreted |
| 30 | Elixir | 406 | 89161728 | 17505478 | 7380020 | 2.37 | Interpreted |
| 31 | Scala | 471 | 55973205 | 18880700 | 8929948 | 2.11 | JIT |
| 32 | TypeScript | 1361 | 208289792 | 17642488 | 7699920 | 2.29 | Interpreted |
## Visualizations
### Execution Time Comparison
```mermaid
xychart-beta
title "Execution Time Comparison - 1000 Decimals"
x-axis ["Crystal", "D", "Zig", "C++", "Fortran", "Nim", "Rust", "C", "Objective-C", "Lua", "Swift", "Odin", "Go", "Assembly", "Bash", "Dart", "Haskell", "Brainfuck", "Perl", "Python"]
y-axis "Time (ms)" 0 --> 26
bar [22, 24, 25, 26, 26, 27, 27, 27, 27, 29, 30, 30, 31, 32, 34, 35, 46, 56, 58, 60]
```
### Memory Usage Comparison
```mermaid
xychart-beta
title "Memory Usage Comparison - 1000 Decimals"
x-axis ["Assembly", "C++", "Nim", "Rust", "C", "Odin", "Fortran", "Bash", "Lua", "D", "Zig", "Crystal", "Go", "Objective-C", "Swift", "Brainfuck", "Python", "Haskell", "Perl", "Dart"]
y-axis "Memory (MB)" 0 --> 1
bar [1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 5, 5, 8, 9, 11, 11, 13]
```
### CPU Efficiency (IPC) Comparison
```mermaid
xychart-beta
title "CPU Efficiency (IPC) Comparison - 1000 Decimals"
x-axis ["D", "Rust", "Fortran", "Swift", "Crystal", "Nim", "Haskell", "C++", "Objective-C", "Zig", "Odin", "Ruby", "Elixir", "Kotlin", "Dart", "TypeScript", "Bash", "PHP", "Erlang", "Perl"]
y-axis "IPC (Instructions Per Cycle)" 0 --> 4
bar [4.0, 3.11, 3.11, 3.03, 2.98, 2.88, 2.75, 2.6, 2.57, 2.56, 2.42, 2.42, 2.37, 2.34, 2.33, 2.29, 2.29, 2.28, 2.27, 2.26]
```
### Time vs Memory Trade-off
```mermaid
graph TD
subgraph "Time vs Memory Trade-off - 1000 Decimals"
Crystal["Crystal<br/>Time: 22ms<br/>Memory: 3MB"]
D["D<br/>Time: 24ms<br/>Memory: 2MB"]
Zig["Zig<br/>Time: 25ms<br/>Memory: 2MB"]
C++["C++<br/>Time: 26ms<br/>Memory: 1MB"]
Fortran["Fortran<br/>Time: 26ms<br/>Memory: 1MB"]
Nim["Nim<br/>Time: 27ms<br/>Memory: 1MB"]
Rust["Rust<br/>Time: 27ms<br/>Memory: 1MB"]
C["C<br/>Time: 27ms<br/>Memory: 1MB"]
Objective-C["Objective-C<br/>Time: 27ms<br/>Memory: 5MB"]
Lua["Lua<br/>Time: 29ms<br/>Memory: 1MB"]
end
```
## Detailed Results
See the full test output in `reports/run_1000_output.txt`.
---
*Generated from Pi Calculation Benchmark - Apple A18 Pro Performance Study*