Write up Rust benchmark variants
parent
d06e8551ad
commit
34aa1eb66b
@ -14,6 +14,8 @@ To evaluate the performance cost, Aaron wrote a benchmark program in Rust and Ja
|
||||
- Find the eigenvalues of $A,\;\ldots\;T^{R-1}A$.
|
||||
|
||||
To validate the computation, the benchmark program displays the eigenvalues of $T^r A$, with $r \in \{0, \ldots, R\}$ controlled by a slider. Displaying the eigenvalues isn't part of the benchmark computation, so it isn't timed.
|
||||
|
||||
The language comparison benchmark uses 64-bit floating point matrices of size $N = 60$. Other variants of the benchmark, used to compare different design decisions within Rust, are described at the end.
|
||||
## Running the benchmark
|
||||
### Rust
|
||||
- To build and run, call `trunk serve --release` from the `rust-benchmark` folder and go to the URL that Trunk is serving.
|
||||
@ -49,3 +51,10 @@ The Rust version typically ran 6–11 times as fast as the Scala version, and it
|
||||
The Rust version typically ran 5–7 times as fast as the Scala version, with comparable consistency.
|
||||
- Rust 80–90 ms
|
||||
- Scala: 520–590 ms
|
||||
## Rust benchmark variants
|
||||
### Low-precision variant
|
||||
- For matrices of size $N = 50$, using 32-bit floating point instead of 64-bit made the computation about 15% faster (60 ms instead of 70 ms). However, for $N \ge 54$, the 32-bit floating point variant would hang indefinitely! Maybe the target precision doesn't change to accommodate the lower-precision data type?
|
||||
### Statically sized variant
|
||||
- For matrices of size $N = 60$, using statically sized matrices instead of dynamically sized ones made the computation about 10% *slower* (125–130 ms instead of 110–120 ms).
|
||||
- For matrices of size $N = 50$, using statically sized matrices made the computation about 15% *slower* (80 ms instead of 70 ms).
|
||||
- For matrices of size $N = 20$, statically and dynamically sized matrices gave comparable run times (12–15 ms).
|
Loading…
Reference in New Issue
Block a user