Improve the performance of tiled decompression#14430
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
|
👋 Thank you for your draft pull request! Do you know that you can use |
|
We should try and re-write _iter_array_tiles to not use Numpy as I think this slows things down a bit |
0ef5093 to
e9f8f07
Compare
6d15639 to
b2921ce
Compare
|
|
||
| # If more than half the data is requested, read in all the heap. | ||
| # TODO: decide what heuristic we actually want here | ||
| if np.product(buffer_shape) > 0.5 * np.product(data_shape): |
b2921ce to
fff7370
Compare
* Read the whole heap in one go if a significant fraction of the data is needed. * Minimize FITS_rec access and cast to np.array as soon as possible * Consolidate code to read in tiles/heap * Other small optimizations
0825234 to
55c3580
Compare
| if algorithm in ("RICE_1", "RICE_ONE", "PLIO_1") and tile_size < len( | ||
| tile_buffer | ||
| ): |
…ng .data might be more appropriate than using .section
|
@saimn - I believe this is ready for review - this speeds things up by a factor of a few in our new tiled compression algorithm, to bring it a lot closer to the original performance in previous astropy versions. |
| # We have to calculate the tilesize from the shape of the tile not the | ||
| # header, so that it's correct for edge tiles etc. | ||
| settings["tilesize"] = prod(actual_tile_shape) | ||
| elif compression_type in ("RICE_1", "RICE_ONE"): |
|
@saimn - I've addressed your comments 😄 |
saimn
left a comment
There was a problem hiding this comment.
Nice improvements, thanks @Cadair & @astrofrog !
This is a work in progress for the moment as we continue to iterate on the performance hot spots.