Repository navigation
Speed up io.votable Boolean array conversions - #18455
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.
|
|
astropy/astropy-benchmarks#141 is merged so theoretically next push would trigger a new benchmark run with the new relevant benchmarks. 🤞 |
0511ee3 to
9fd26a4
Compare
|
Hmm this PR does not appear to make any difference wrt to the new benchmarks added, unlike #18454 . Should we close without merge? |
|
I'd like @eerovaher to have a chance to try and see why this does not affect the benchmark before closing. It would be a lot nicer to rely on Numpy if we can rather than introducing yet more C/Cython code. |
|
I don't know much about neither VOTable nor the implementation details of It is not obvious to me that |
9fd26a4 to
e436c09
Compare
|
I rebased this PR now that there are benchmarks for the functionality being modified, but those benchmarks are so slow that they were aborted, so we still can't compare timings. |
|
The benchmark has failed for both before and after cases it seems? |
|
Yes indeed, so the problem is not with this pull request but with the benchmarks themselves. |
Calling `numpy` functions is faster than bit fiddling in Python.
e436c09 to
5447b3a
Compare
bsipocz
left a comment
There was a problem hiding this comment.
While these two functions are only a small portion of the improvements in #18454, I nevertheless share the sentiment that more numpy and less Cython and C is better if we can have similar performance with np.
So lets go ahead and merge this now, and then we can rebase #18454 and cleanup if needed.
Thanks @eerovaher!
Description
#18454 is proposing speeding up parts of
io.votableby rewriting a few Python implementations in Cython. Here I am proposing to replace some of the Python implementations withnumpyfunction calls. For now I am only rewriting two Boolean array conversion functions. I have not looked at the other functions yet, so I am not sure right now if they can be sped up in a similar manner or not, but I decided to open this pull request early so that it can compete with #18454.Timing setup
Timing results on current
main(8599d49)Timing results with this patch