aboutsummaryrefslogtreecommitdiff
path: root/src/platform.rs
diff options
context:
space:
mode:
authorJack O'Connor <[email protected]>2019-12-03 16:23:19 -0500
committerJack O'Connor <[email protected]>2019-12-03 16:23:19 -0500
commit7736b254cef487147408f13b175c1ac6d5c41b37 (patch)
tree1de30436ab7a565f4a5d83df8d4375bf77cc3abc /src/platform.rs
parentccdff5db592ca7a46d82dea0ac5973f825cef2db (diff)
implementation notes
Diffstat (limited to 'src/platform.rs')
-rw-r--r--src/platform.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/platform.rs b/src/platform.rs
index 54f59c0..4a3be0d 100644
--- a/src/platform.rs
+++ b/src/platform.rs
@@ -61,6 +61,16 @@ impl Platform {
}
}
+ // IMPLEMENTATION NOTE
+ // ===================
+ // hash_many() applies two optimizations. The critically important
+ // optimization is the high-performance parallel SIMD hashing mode,
+ // described in detail in the spec. This more than doubles throughput per
+ // thread. Another optimization is keeping the state vectors transposed
+ // from block to block within a chunk. When state vectors are transposed
+ // after every block, there's a small but measurable performance loss.
+ // Compressing chunks with a dedicated loop avoids this.
+
pub fn hash_many<A: arrayvec::Array<Item = u8>>(
&self,
inputs: &[&A],