This is how I tested the performance of OMERO.webclient paths_to_object, handling pagination of the object when in a Dataset or Orphaned collection of many images, as described ome/openmicroscopy#4511
First, I added print statements to components/tools/OmeroWeb/omeroweb/webclient/views.py to print the time that paths_to_object takes to return:
+ n = time()
paths = paths_to_object(conn, experimenter_id, project_id, dataset_id,
image_id, screen_id, plate_id, acquisition_id,
well_id, group_id)