Performance tuning for pack()