Optimize perm_t memory footprint with index maps