speedup preprocessing process