|
1 | 1 | # Memory Usage Comparison |
2 | 2 |
|
3 | | -**Generated:** 2025-12-17 19:54:09 |
| 3 | +**Generated:** 2025-12-18 10:02:36 |
4 | 4 |
|
5 | 5 | ## Repository Versions |
6 | 6 |
|
7 | 7 | | Project | Commit | |
8 | 8 | |---------|--------| |
9 | | -| swift-justhtml | `2e01d93a6cd5` | |
| 9 | +| swift-justhtml | `c1eb87378893` | |
10 | 10 | | justhtml (Python) | `63c29b26be64` | |
11 | 11 | | justjshtml (JavaScript) | `e29dbd3166e9` | |
| 12 | +| html5ever (Rust) | `795caf4166a8` | |
12 | 13 |
|
13 | 14 | ## Peak Memory Usage (RSS) |
14 | 15 |
|
15 | | -| File | Size | Swift | Python | JavaScript | Swift vs Python | Swift vs JS | |
16 | | -|------|------|-------|--------|------------|-----------------|-------------| |
17 | | -| hackernews.html | 33.67 KB | 19.77 MB | 14.73 MB | 58.80 MB | 1.34x more | 2.98x less | |
18 | | -| synthetic.html | 20.02 MB | 475.09 MB | 505.55 MB | 866.20 MB | 1.06x less | 1.82x less | |
19 | | -| wikipedia_countries.html | 360.45 KB | 26.35 MB | 22.86 MB | 90.63 MB | 1.15x more | 3.44x less | |
20 | | -| wikipedia_html.html | 472.45 KB | 27.95 MB | 24.87 MB | 91.56 MB | 1.12x more | 3.28x less | |
21 | | -| wikipedia_swift.html | 410.54 KB | 26.93 MB | 24.44 MB | 90.68 MB | 1.10x more | 3.37x less | |
22 | | -| wikipedia_ww2.html | 1.18 MB | 40.15 MB | 42.68 MB | 155.99 MB | 1.06x less | 3.89x less | |
| 16 | +| File | Size | Rust | Swift | JavaScript | Python | Rust vs Swift | |
| 17 | +|------|------|------|-------|------------|--------|---------------| |
| 18 | +| hackernews.html | 33.67 KB | 3.18 MB | 19.79 MB | 59.10 MB | 14.68 MB | 6.22x less | |
| 19 | +| synthetic.html | 20.02 MB | 216.40 MB | 475.22 MB | 863.95 MB | 505.52 MB | 2.20x less | |
| 20 | +| wikipedia_countries.html | 360.45 KB | 6.07 MB | 26.45 MB | 90.53 MB | 22.87 MB | 4.36x less | |
| 21 | +| wikipedia_html.html | 472.45 KB | 7.13 MB | 28.32 MB | 94.62 MB | 25.00 MB | 3.97x less | |
| 22 | +| wikipedia_swift.html | 410.54 KB | 6.69 MB | 26.80 MB | 90.43 MB | 24.52 MB | 4.01x less | |
| 23 | +| wikipedia_ww2.html | 1.18 MB | 12.52 MB | 40.18 MB | 155.27 MB | 42.46 MB | 3.21x less | |
23 | 24 |
|
24 | 25 | ## Summary |
25 | 26 |
|
26 | 27 | Average peak memory usage across 6 files: |
27 | 28 |
|
28 | | -- **Swift**: 102.71 MB |
29 | | -- **Python**: 105.85 MB |
30 | | -- **JavaScript**: 225.64 MB |
| 29 | +- **Rust (html5ever)**: 42.00 MB |
| 30 | +- **Swift**: 102.79 MB |
| 31 | +- **JavaScript**: 225.65 MB |
| 32 | +- **Python**: 105.84 MB |
31 | 33 |
|
32 | | -Swift uses **1.03x less memory** than Python on average. |
33 | | -Swift uses **2.20x less memory** than JavaScript on average. |
| 34 | +Rust uses **2.45x less memory** than Swift on average. |
| 35 | +Rust uses **5.37x less memory** than JavaScript on average. |
| 36 | +Rust uses **2.52x less memory** than Python on average. |
34 | 37 |
|
35 | 38 | *Note: Memory measurements are peak RSS (Resident Set Size) which includes shared libraries and may vary between runs.* |
0 commit comments