reduced memory overhead with proper types and structure packing