speed up allocation in filter