Skip to content

Parsing slow because of noarch build #30

@sterlinm

Description

@sterlinm

Issue:

It looks like this recipe only builds the pure python version of pendulum, so the parsing is significantly slower than the version you get from pip which includes the compiled extensions.

String parsing using pendulum installed with conda:

In [1]: from pendulum.parsing import parse_iso8601

In [2]: %timeit parse_iso8601('2021-12-31 12:15:33+00:00')
24.5 µs ± 2.06 µs per loop (mean ± std. dev. of 7 runs, 10,000 loops each)

String parsing using pendulum installed with pip

In [1]: from pendulum.parsing import parse_iso8601

In [2]: %timeit parse_iso8601('2021-12-31 12:15:33+00:00')
292 ns ± 14.9 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)

Here's the difference in the site-packages directory:

(pip_pendulum) jovyan@jupyter-jupyterlab-2djupyterlab-2ddemo-2dvf19hhtr:~$ ls /srv/conda/envs/pip_pendulum/lib/python3.10/site-packages/pendulum/parsing
exceptions  __init__.py  _iso8601.c  _iso8601.cpython-310-x86_64-linux-gnu.so  iso8601.py  __pycache__
(pip_pendulum) jovyan@jupyter-jupyterlab-2djupyterlab-2ddemo-2dvf19hhtr:~$ ls /srv/conda/envs/conda_pendulum/lib/python3.10/site-packages/pendulum/parsing/
exceptions  __init__.py  _iso8601.c  iso8601.py  __pycache__

I haven't created a conda recipe before, but I'm happy to have a go at creating a pull request. The situation is pretty much the same on Windows.


conda_pendulum environment (conda list):
Details
$ conda list
# packages in environment at /srv/conda/envs/conda_pendulum:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
asttokens                 2.0.5              pyhd8ed1ab_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
black                     22.1.0             pyhd8ed1ab_0    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
ca-certificates           2021.10.8            ha878542_0    conda-forge
click                     8.0.3                    pypi_0    pypi
dataclasses               0.8                pyhc8e2a94_3    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
executing                 0.8.2              pyhd8ed1ab_0    conda-forge
ipython                   8.0.1                    pypi_0    pypi
jedi                      0.18.1                   pypi_0    pypi
ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 11.2.0              h1d223b6_12    conda-forge
libgomp                   11.2.0              h1d223b6_12    conda-forge
libnsl                    2.0.0                h7f98852_0    conda-forge
libuuid                   2.32.1            h7f98852_1000    conda-forge
libzlib                   1.2.11            h36c2ea0_1013    conda-forge
matplotlib-inline         0.1.3              pyhd8ed1ab_0    conda-forge
mypy-extensions           0.4.3                    pypi_0    pypi
mypy_extensions           0.4.3           py310hff52083_4    conda-forge
ncurses                   6.3                  h9c3ff4c_0    conda-forge
openssl                   3.0.0                h7f98852_2    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
pathspec                  0.9.0              pyhd8ed1ab_0    conda-forge
pendulum                  2.1.2              pyhd8ed1ab_1    conda-forge
pexpect                   4.8.0              pyh9f0ad1d_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pip                       22.0.3             pyhd8ed1ab_0    conda-forge
platformdirs              2.5.0              pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.27             pyha770c72_0    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
pygments                  2.11.2             pyhd8ed1ab_0    conda-forge
python                    3.10.2          hc74c709_3_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python_abi                3.10                    2_cp310    conda-forge
pytzdata                  2020.1             pyh9f0ad1d_0    conda-forge
readline                  8.1                  h46c0cb4_0    conda-forge
setuptools                60.9.2                   pypi_0    pypi
six                       1.16.0             pyh6c4a22f_0    conda-forge
sqlite                    3.37.0               h9cd32fc_0    conda-forge
stack_data                0.2.0              pyhd8ed1ab_0    conda-forge
tk                        8.6.12               h27826a3_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
traitlets                 5.1.1              pyhd8ed1ab_0    conda-forge
typed-ast                 1.5.2                    pypi_0    pypi
typing_extensions         4.1.1              pyha770c72_0    conda-forge
tzdata                    2021e                he74cb21_0    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
zlib                      1.2.11            h36c2ea0_1013    conda-forge

pip_pendulum environment (conda list):
Details
$ conda list
# packages in environment at /srv/conda/envs/pip_pendulum:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
asttokens                 2.0.5              pyhd8ed1ab_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
black                     22.1.0             pyhd8ed1ab_0    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
ca-certificates           2021.10.8            ha878542_0    conda-forge
click                     8.0.3                    pypi_0    pypi
dataclasses               0.8                pyhc8e2a94_3    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
executing                 0.8.2              pyhd8ed1ab_0    conda-forge
ipython                   8.0.1                    pypi_0    pypi
jedi                      0.18.1                   pypi_0    pypi
ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 11.2.0              h1d223b6_12    conda-forge
libgomp                   11.2.0              h1d223b6_12    conda-forge
libnsl                    2.0.0                h7f98852_0    conda-forge
libuuid                   2.32.1            h7f98852_1000    conda-forge
libzlib                   1.2.11            h36c2ea0_1013    conda-forge
matplotlib-inline         0.1.3              pyhd8ed1ab_0    conda-forge
mypy-extensions           0.4.3                    pypi_0    pypi
mypy_extensions           0.4.3           py310hff52083_4    conda-forge
ncurses                   6.3                  h9c3ff4c_0    conda-forge
openssl                   3.0.0                h7f98852_2    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
pathspec                  0.9.0              pyhd8ed1ab_0    conda-forge
pendulum                  2.1.2                    pypi_0    pypi
pexpect                   4.8.0              pyh9f0ad1d_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pip                       22.0.3             pyhd8ed1ab_0    conda-forge
platformdirs              2.5.0              pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.27             pyha770c72_0    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
pygments                  2.11.2             pyhd8ed1ab_0    conda-forge
python                    3.10.2          hc74c709_3_cpython    conda-forge
python-dateutil           2.8.2                    pypi_0    pypi
python_abi                3.10                    2_cp310    conda-forge
pytzdata                  2020.1                   pypi_0    pypi
readline                  8.1                  h46c0cb4_0    conda-forge
setuptools                60.9.2                   pypi_0    pypi
six                       1.16.0             pyh6c4a22f_0    conda-forge
sqlite                    3.37.0               h9cd32fc_0    conda-forge
stack_data                0.2.0              pyhd8ed1ab_0    conda-forge
tk                        8.6.12               h27826a3_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
traitlets                 5.1.1              pyhd8ed1ab_0    conda-forge
typed-ast                 1.5.2                    pypi_0    pypi
typing_extensions         4.1.1              pyha770c72_0    conda-forge
tzdata                    2021e                he74cb21_0    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
zlib                      1.2.11            h36c2ea0_1013    conda-forge

Details about conda and system ( conda info ):

Details
$ conda info

     active environment : pip_pendulum
    active env location : /srv/conda/envs/pip_pendulum
            shell level : 3
       user config file : /home/jovyan/.condarc
 populated config files : /srv/conda/.condarc
          conda version : 4.9.2
    conda-build version : not installed
         python version : 3.8.6.final.0
       virtual packages : __glibc=2.27=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /srv/conda  (writable)
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /srv/conda/pkgs
                          /home/jovyan/.conda/pkgs
       envs directories : /srv/conda/envs
                          /home/jovyan/.conda/envs
               platform : linux-64
             user-agent : conda/4.9.2 requests/2.25.0 CPython/3.8.6 Linux/5.4.0-1035-azure ubuntu/18.04.6 glibc/2.27
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions