You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5af46a9
Browse filesBrowse the repository at this point in the historyBrowse files
| MiniExcel Rust base revision |`808828f3ce892dad8b00bda1cee370fae6451e1c`|
46
+
| MiniExcel Rust | Source tree containing this document; optimization baseline`808828f3ce892dad8b00bda1cee370fae6451e1c`|
47
47
48
48
## Summary
49
49
50
50
Both implementations returned exactly 100,000 rows and 1,000,000 cells per pass in every measured process.
51
51
52
52
| Scenario | Runtime | Median Query time | Throughput | Median process time | Median peak working set | Maximum peak working set |
53
53
| --- | --- | ---: | ---: | ---: | ---: | ---: |
54
-
| Cold | .NET v1 | 1,890.76 ms |52,889 rows/s | 1,963.50 ms |67.22 MB | 68.12 MB |
55
-
| Cold | Rust |1,455.79 ms |68,691 rows/s |1,473.66 ms | 9.71 MB | 9.77 MB |
56
-
| Steady | .NET v1 | 2,585.18 ms |116,046 rows/s | 4,499.20 ms |78.75 MB |82.07 MB |
57
-
| Steady | Rust |4,209.62 ms |71,265 rows/s |5,728.73 ms | 9.91 MB | 9.94 MB |
54
+
| Cold | .NET v1 | 1,714.86 ms |58,314 rows/s | 1,769.77 ms |66.84 MB | 68.19 MB |
55
+
| Cold | Rust |674.59 ms |148,238 rows/s |681.71 ms | 9.64 MB | 9.72 MB |
56
+
| Steady | .NET v1 | 2,330.46 ms |128,730 rows/s | 4,069.78 ms |80.35 MB |84.28 MB |
57
+
| Steady | Rust |2,079.01 ms |144,299 rows/s |2,792.32 ms | 9.88 MB | 9.93 MB |
58
58
59
-
For the first Query in a fresh process, Rust delivered 1.30x the .NET v1 throughput, completed in 23.0% less Query time, and used 85.6% less peak working set.
59
+
For the first Query in a fresh process, Rust delivered 2.54x the .NET v1 throughput, completed in 60.7% less Query time, and used 85.6% less peak working set.
60
60
61
-
After an in-process warm-up, Rust delivered 0.61x the .NET v1 throughput and took 62.8% more Query time. Its median peak working set remained 87.4% lower, at 9.91 MB versus 78.75 MB.
61
+
After an in-process warm-up, Rust delivered 1.12x the .NET v1 throughput and completed in 10.8% less Query time. Its median peak working set was 87.7% lower, at 9.88 MB versus 80.35 MB.
62
62
63
-
The result is therefore workload-dependent: Rust has lower first-call latency and substantially lower memory use here, while .NET v1 has higher sustained throughput after JIT warm-up.
63
+
Relative to the Rust optimization baseline, median Query time decreased by 53.7% in the Cold scenario and 50.6% in the Steady scenario without increasing peak working set.
| 1 | 2,401.10 ms |79.22 MB |4,209.62 ms | 9.92 MB |
82
-
| 2 | 2,602.98 ms |78.44 MB |4,128.13 ms | 9.91 MB |
83
-
| 3 | 2,554.63 ms |82.07 MB |4,357.14 ms | 9.89 MB |
84
-
| 4 | 2,766.50 ms |78.75 MB |4,205.49 ms | 9.94 MB |
85
-
| 5 | 2,585.18 ms |78.27 MB |4,254.68 ms | 9.80 MB |
81
+
| 1 | 2,408.23 ms |80.28 MB |2,143.49 ms | 9.86 MB |
82
+
| 2 | 2,349.56 ms |84.28 MB |2,294.03 ms | 9.90 MB |
83
+
| 3 | 2,325.04 ms |79.41 MB |2,079.01 ms | 9.82 MB |
84
+
| 4 | 2,308.75 ms |80.35 MB |2,011.56 ms | 9.93 MB |
85
+
| 5 | 2,330.46 ms |80.45 MB |2,013.23 ms | 9.88 MB |
86
86
87
87
## Interpretation
88
88
89
89
The benchmark workbook contains 1,000,000 shared-string cells, 100,000 unique strings, and no merged ranges. Its worksheet XML expands to 39,167,847 bytes.
90
90
91
-
Rust currently performs a complete worksheet scan before the emitting pass, even though this workbook has a valid `<dimension>` and merged-cell filling is disabled. It also clones each shared-string value into an intermediate `Data::String`and then again into the public `CellValue::String`, clones dynamic column names for every row, and transfers each parsed row through a bounded synchronous channel. These choices preserve bounded memory and iterator ownership but add steady-state work.
91
+
Rust now uses a valid `<dimension>` as the query extent when merged-cell filling does not require a complete worksheet scan. An explicit end cell skips the preliminary extent read as well. The parser reads hot row and cell attributes in one borrowed pass, parses shared-string indices without temporary `String` allocations, preallocates bounded row storage from the selected width, and moves owned string data from the intermediate `Data::String` into the public `CellValue::String`.
92
92
93
-
.NET v1 can stop its preliminary extent check as soon as it reads `<dimension ref="A1:J100000">`. Its JIT cost makes the first Query slower, but later Query passes benefit from already compiled and dynamically optimized hot paths. This explains why Rust leads in the cold scenario while .NET v1 leads in the steady scenario.
93
+
The remaining per-row work includes cloning owned dynamic column names and transferring parsed rows through a bounded synchronous channel. These costs preserve the current `IndexMap<String, CellValue>` API, bounded memory, and iterator ownership. In this workbook, the optimized Rust path leads .NET v1 in both first-call latency and warmed sustained throughput while retaining substantially lower peak memory.
94
94
95
95
These numbers describe one workbook and one machine, not a general performance guarantee. The harness does not pin CPU affinity or suppress all operating-system noise; the median limits the effect of outliers. Use representative workbooks before drawing application-specific conclusions.
0 commit comments