Better HN
topnewbestaskshowjobs
Log inSign up

hamsham

7 karma · joined Feb 21, 2016 (10y ago) · 2 submissions

Submissions

comment 7y ago · link · parent

I recently ran into an issue in a game where my team and I were storing hundreds of 160-byte config structures in memory. It blew up to over 86kb of data (which doesn't seem like much, but we're already pressed for memory at a 64mb-limit). I compressed the configs by packing the structure into a 2-byte bitfield, simply twiddling bits to get/set each parameter, and just like that the 86 kilobyte configs dropped to just over 1kb. We're still trying to reduce memory elsewhere but the savings showed we can do similar tricks to significantly save our memory footprint in other places.

comment 7y ago · link · parent

Out of curiosity, how have you managed to do that? I've noticed even with GCC or Clang's -O3 option I'm still getting jumps rather than conditional moves.