Improve create polyline performance