Selecting random points of a PolyData (Stratified sampling)

Will this algorithm work for meshes having around 2-3 million points ?
Currently the code is crashing and I am checking if reducing the dimension will make it work.