Instantiating a lot of quads for an unstructured grid

Hi everyone!

For a plugin I am trying to write, I need to create a surface consisting of about 300k quads. These quads are regularly spaced on the x & y axes, but have varying z levels.
The surface is also not rectangular, but has irregular edges, like this:

(the outer black border indicates NODATA, the inner grey fields are height data)

I have a native module that generates two numpy arrays for me,

x  y  z


id id id id

where the rows of ids from the quads array indicate rows from the positions array to use as vertex coordinates.

Currently I am generating a vtkUnstructuredGrid by first creating vtkPoints:

coordinates = algs.make_vector(positions[:,0], positions[:,1],positions[:,2])
points = vtkPoints()
points.SetData(dsa.numpyTovtkDataArray(coordinates, 'Points'))

and then individually inserting vtkIdLists to create the quads

 for i in range(quads.shape[0]):
            pids = vtkIdList()
            output.InsertNextCell(VTK_QUAD, pointIds)

This is of course really slow and manages to fill up my RAM rather quickly.
Is there a faster way to do this?

Is a vtkUnstructuredGrid even the correct data structure for this task?

Thanks in advance!