Skip to content

Commit d76a257

Browse files
committed
PERF: leverage tzlocal package to provide 2000x speedup for dateutil.tz.tzlocal operations
1 parent b9f2e2b commit d76a257

21 files changed

+139
-14
lines changed

asv_bench/asv.conf.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"xlrd": [],
5252
"xlwt": [],
5353
"pytest": [],
54+
"tzlocal": [],
5455
// If using Windows with python 2.7 and want to build using the
5556
// mingw toolchain (rather than MSVC), uncomment the following line.
5657
// "libpython": [],

ci/deps/azure-27-compat.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ dependencies:
1010
- numpy=1.12.0
1111
- openpyxl=2.5.5
1212
- pytables=3.4.2
13-
- python-dateutil=2.5.0
13+
- python-dateutil=2.6.0
1414
- python=2.7*
1515
- pytz=2013b
1616
- scipy=0.18.1
17+
- tzlocal=1.5.1
1718
- xlrd=1.0.0
1819
- xlsxwriter=0.5.2
1920
- xlwt=0.7.5

ci/deps/azure-27-locale.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dependencies:
1616
- pytz=2013b
1717
- scipy
1818
- sqlalchemy=0.8.1
19+
- tzlocal=1.5.1
1920
- xlrd=1.0.0
2021
- xlsxwriter=0.5.2
2122
- xlwt=0.7.5

ci/deps/azure-macos-35.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ dependencies:
1717
- pytables
1818
- python=3.5*
1919
- pytz
20+
- tzlocal
2021
- xarray
2122
- xlrd
2223
- xlsxwriter
@@ -25,5 +26,5 @@ dependencies:
2526
- pytest
2627
- pytest-xdist
2728
- pip:
28-
- python-dateutil==2.5.3
29+
- python-dateutil==2.6.0
2930
- hypothesis>=3.58.0

ci/deps/azure-windows-27.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ dependencies:
2020
- s3fs
2121
- scipy
2222
- sqlalchemy
23+
- tzlocal
2324
- xlrd
2425
- xlsxwriter
2526
- xlwt

ci/deps/azure-windows-36.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ dependencies:
1818
- python=3.6.6
1919
- pytz
2020
- scipy
21+
- tzlocal
2122
- xlrd
2223
- xlsxwriter
2324
- xlwt

ci/deps/travis-27.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ dependencies:
2828
- pytables
2929
- blosc=1.14.3
3030
- python-blosc
31-
- python-dateutil=2.5.0
31+
- python-dateutil=2.6.0
3232
- python=2.7*
3333
- pytz=2013b
3434
- s3fs
3535
- scipy
3636
- sqlalchemy=0.9.6
37+
- tzlocal
3738
- xarray=0.9.6
3839
- xlrd=1.0.0
3940
- xlsxwriter=0.5.2

ci/deps/travis-36-doc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ dependencies:
3636
- sphinx
3737
- sqlalchemy
3838
- statsmodels
39+
- tzlocal
3940
- xarray
4041
- xlrd
4142
- xlsxwriter

doc/source/install.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ Recommended Dependencies
241241
evaluations. ``bottleneck`` uses specialized cython routines to achieve large speedups. If installed,
242242
must be Version 1.2.0 or higher.
243243

244+
* `tzlocal <https://github.com/regebro/tzlocal>`__: significantly beneficial to performance if using the `dateutil.tz.tzlocal()` timezone.
245+
244246
.. note::
245247

246248
You are highly encouraged to install these libraries, as they provide speed improvements, especially
@@ -328,7 +330,6 @@ Optional Dependencies
328330
to get the necessary dependencies for installation of `lxml`_. This
329331
will prevent further headaches down the line.
330332

331-
332333
.. _html5lib: https://github.com/html5lib/html5lib-python
333334
.. _BeautifulSoup4: http://www.crummy.com/software/BeautifulSoup
334335
.. _lxml: http://lxml.de

environment.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66
# required
77
- numpy>=1.15
88
- python=3
9-
- python-dateutil>=2.5.0
9+
- python-dateutil>=2.6.0
1010
- pytz
1111

1212
# development
@@ -48,6 +48,7 @@ dependencies:
4848
- seaborn
4949
- sqlalchemy
5050
- statsmodels
51+
- tzlocal
5152
- xarray
5253
- xlrd
5354
- xlsxwriter

0 commit comments

Comments
 (0)