ENH: Faster hashing of Period objects #12817
Labels
Dtype Conversions
Unexpected or buggy dtype conversions
Performance
Memory or execution speed performance
Period
Period data type
Milestone
I've noticed that a lot of manipulations using Periods are pretty slow. It looks like it's hashing the tuple of the
ordinal
andfreq
attributes. I'm not sure what the mapping is betweenfreq
andfreqstr
is, but iffreqstr
can stand in forfreq
, it looks like hashing the string gives a decent speedup. SubclassingPeriod
with this change speeds up operations likedrop_duplicates
a lot on my machine.Does this change seem reasonable?
output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.5.1.final.0
python-bits: 64
OS: Darwin
OS-release: 15.3.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.18.0
nose: None
pip: 8.1.1
setuptools: 20.3
Cython: 0.23.5
numpy: 1.10.4
scipy: 0.17.0
statsmodels: None
xarray: None
IPython: 3.2.3
sphinx: None
patsy: None
dateutil: 2.5.2
pytz: 2016.3
blosc: None
bottleneck: None
tables: None
numexpr: 2.5.1
matplotlib: 1.5.1
openpyxl: None
xlrd: 0.9.4
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
The text was updated successfully, but these errors were encountered: