Skip to content

Commit 3599da1

Browse files
committed
Remove pandas docstrings
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.
1 parent f5bc181 commit 3599da1

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

packages/pandas/meta.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ source:
55
url: https://files.pythonhosted.org/packages/5a/ac/b3b9aa2318de52e40c26ae7b9ce6d4e9d1bcdaf5da0899a691642117cf60/pandas-1.4.2.tar.gz
66
sha256: 92bc1fc585f1463ca827b45535957815b7deb218c549b7c18402c322c7549a12
77
patches:
8-
- patches/fix_json_signature.patch
8+
- patches/0001-fix_json_signature.patch
9+
- patches/0002-PERF-Remove-docstrings-from-inline-cython-code.patch
910
build:
1011
cflags:
1112
-Werror=implicit-function-declaration -Werror=mismatched-parameter-types
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
From e073902997d05a30734cd08b23cef9274adcb2af Mon Sep 17 00:00:00 2001
2+
From: William Lachance <[email protected]>
3+
Date: Tue, 3 May 2022 15:55:12 -0400
4+
Subject: [PATCH] PERF: Remove docstrings from inline cython code
5+
6+
These functions aren't externally available, and removing them saves
7+
a small amount of space (approximately 250k in the size of the generated
8+
.so's on a linux64 machine).
9+
---
10+
setup.py | 3 +++
11+
1 file changed, 3 insertions(+)
12+
13+
diff --git a/setup.py b/setup.py
14+
index 67b91c55dd..11e3494b72 100755
15+
--- a/setup.py
16+
+++ b/setup.py
17+
@@ -46,8 +46,11 @@ try:
18+
__version__ as _CYTHON_VERSION,
19+
)
20+
from Cython.Build import cythonize
21+
+ from Cython.Compiler import Options
22+
23+
_CYTHON_INSTALLED = parse_version(_CYTHON_VERSION) >= parse_version(min_cython_ver)
24+
+ Options.docstrings = False
25+
+
26+
except ImportError:
27+
_CYTHON_VERSION = None
28+
_CYTHON_INSTALLED = False
29+
--
30+
2.34.1
31+

0 commit comments

Comments
 (0)