improve performance of big data script