-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PERF: Remove docstrings from inline cython code #46934
Conversation
These functions aren't externally available, and removing them saves a small amount of space (approximately 250k in the size of the generated .so's on a linux64 machine).
More details: base sizes: https://gist.github.com/wlach/d1a70c3246e51137e71d6f992ff34149 Calculating savings:
I am especially interested in this for the case of pyodide, where the load times of pandas is a very large bottleneck: pyodide/pyodide#347 I don't expect this to help that much, but any savings (which doesn't affect end user functionality) is welcome. |
Local patch of pandas-dev/pandas#46934 I don't expect this to make a user-noticeable improvement, but it seems worth doing regardless. Locally I see a reduction from 4546988 for the whole wheel to 4545234 (so just under 1k) although some of the .so's inside are a few kB smaller.
Thanks for the PR! I'm not sure they are really private, because this does break some of the tests checking docstrings. |
If you can get this passing the CI, this sounds good to me. |
|
||
_CYTHON_INSTALLED = parse_version(_CYTHON_VERSION) >= parse_version(min_cython_ver) | ||
Options.docstrings = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a comment pointing back to this PR
Yes, I think you're right on closer inspection (I had a hard time understanding the test runs) -- and it's quite likely it's the larger docstrings which are the ones that are really needed. This is probably not worth pursuing, but I'll leave this open for a bit in case I'm missing something obvious. |
Perhaps you could try making this a compile time option that is disabled by default? |
Not my call, but I'd personally be a bit reluctant to do this -- the savings aren't IMO great enough to justify the increased complexity. |
As an aside, if you're looking to implement space savings, there has been consensus to remove tests from the distribution: #30741 |
We are already unvendoring pandas tests as a separate package in Pyodide, so that is not an issue. |
This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this. |
Looks like we're not moving forward with this, and the discussion is stale, closing. |
These functions aren't externally available, and removing them saves
a small amount of space (approximately 250k in the size of the generated
.so's on a linux64 machine).