Having a path, for example: 
composed of a set of points ‘p’
I have a set of randomly placed points, both inside and outside. called ‘n’

So to compare all the points inside to the points on the path to the random points, would be probably exponentially complex. Something like O(n) = n^p if I’m not mistaken It’s O(n) = n*p
So to solve the problem I am thinking that you could subdivide the path in a minimum area that is completely outside, and other that is completely inside. as in the figure

The green set would be inside, the black outside and the orange to be iterated again several times

Is this possible, and more importantly, is it efficient?
Consider looking at point-in-polygon testing literature.
With this large number of points, I can imagine a y-sweeping approach to be sensible and efficient. Much more than this iteration thing you are trying to do.