In grand_product.rs we have a sparse version of GKR which uses the type SparseGrandProductLayer<F> = Vec<(usize, F)>. Due to strict alignment rules I believe this takes up 64 bytes per element rather than 8 + 32 = 40. Switching the order to store the sparse tuples Vec<(F, usize)> might work, but I'd need to look into alignment rules. Does every tuple start on a 32-byte or 64-byte memory boundary adding implicit packing?
Alternatively we could move the indices to their own vector which would have tighter packing.
In
grand_product.rs
we have a sparse version of GKR which uses the typeSparseGrandProductLayer<F> = Vec<(usize, F)>
. Due to strict alignment rules I believe this takes up 64 bytes per element rather than 8 + 32 = 40. Switching the order to store the sparse tuplesVec<(F, usize)>
might work, but I'd need to look into alignment rules. Does every tuple start on a 32-byte or 64-byte memory boundary adding implicit packing?Alternatively we could move the indices to their own vector which would have tighter packing.