Repository navigation
Conversation
…rove SkyCoord initialization performance
|
Hi there @astrofrog 👋 - thanks for the pull request! I'm just a friendly 🤖 that checks for issues related to the changelog and making sure that this pull request is milestoned and labeled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part 😃. I see this is a work in progress pull request. I'll report back on the checks once the PR is ready for review. If there are any issues with this message, please report them here. |
|
And of course there are complications ;) I'll investigate the test failures. |
|
Ok so there is way too much class magic going on in astropy.coordinates, and this doesn't work. See #7615 for caching on an instance level which still provides a factor of ~2 improvement. I really think it would be good to tidy up the frame code so that things can be computed once and for all for each frame, and I think there is a fair bit of opportunity there for optimization, but I don't have the time to do this. I'll leave this open for @eteq and @adrn to see that it doesn't work, but feel free to close. |
|
I'm going to go ahead and close this |
This implements the caching of
representation_infoon frames on a class level to speed up initialization of SkyCoords (as described in #2989)Before
After
There is a speedup even when initializing a single
SkyCoordbecause_get_representation_infogets called 10 times for eachSkyCoordinitialization, so the caching helps even for a single initialization.I think in general there are other things in frames that could be classed at a class level, for example
representation_component_namesandrepresentation_component_units. I don't have time to look into other optimizations, but this one was bugging me since it's such a simple fix.