Cell selection function principle in paraview in order to migrate it to other vtk project

I want to read the cell id inside vtkUnstructuredGrid.But vtkCellPicker works very slowly.I want to use vtk to implement the “hover cells on” function of paraview software in vtkUnstructuredGrid to get the cell id. But I don’t know how this function is implemented in paraview, so how can I migrate it to other python code?

this is my old python code,It runs very slowly when the number of cells is large:
picker = vtk.vtkCellPicker()
picker.Pick(clickPos[0], clickPos[1], 0, self.GetDefaultRenderer())
iSel = picker.GetCellId() # very slow

But I found that the “hover cells on” function in paraview reads the cell id very fast.How is it achieved?

ParaView uses a custom subclass of vtkHardwareSelector for fast cell selection (specifically, vtkPVHardwareSelector. If you want to see how it is used, please see https://gitlab.kitware.com/paraview/paraview/blob/master/ParaViewCore/ClientServerCore/Rendering/vtkPVRenderView.cxx

A simpler example is available at the VTK Examples wiki.

Thank you very much for providing very important information, I think it will help others too.