nir/serialize: pack src better and limit the object count to 1M from 1G