yt-project / yt

Main yt repository
http://yt-project.org
Other
469 stars 278 forks source link

particle IO handlers: avoid building selector mask for `all_data()` #4593

Open chrishavlin opened 1 year ago

chrishavlin commented 1 year ago

A number of implementations of _read_particle_fields always build a mask from the selector object. In the case where the selector is all_data(), the selection can be sped up by simply returning the full index range without building a mask, see #4579 for an example of switching ytdata. I looked through all the _read_particle_fields functions to compile a list of implementations that might benefit from adding the all_data() check:

And for reference, some of the IO handlers that already check for all_data() to avoid building the mask: IOHandlerTipsyBinary, IOHandlerGadgetHDF5, IOHandlerOWLS

chrishavlin commented 1 year ago

note that there may be reasons for some of the handlers that they should always build the mask... so if anyone has insight there, definitely let me know and we can remove them from the above list.