CodeKnight & CopyPaste
I've been trying to find a more efficient way to represent large sparse matrices in memory. Any ideas on balancing compression with fast access?
Hey, if you’re hunting for the sweet spot between compression and speed, give CSR or CSC a spin – they’re the OGs for row‑major or column‑major sweeps. If you can afford a bit of overhead, COO’s great for random inserts, then pack it into a compressed block format like BCSR or ELLPACK when you hit regular patterns. For really crazy sparsity, look at sparse hash tables or bit‑packed indices – they keep cache lines tight but can slow a single lookup a tad. Bottom line: keep the data layout friendly to your access pattern; a small cache‑friendly chunk often beats a monolithic compressed blob. Happy hacking!