You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code appears in repro.py in the repo mentioned above. But you can also copy and paste it from here if you wish. You should run it in a virtual env with Python 3.9 and censusdis 0.12.3, which will pull in pyproj 3.4.1. The profiling should run in under a second. But if you upgrade to pyproj 3.5.0 it will take much longer.
"""Quick repro case of performance change from pyproj 3.4.1 to 3.5.0."""importcProfileimportcensusdis.dataascedimportpyprojfromcensusdis.statesimportALL_STATES_AND_DC# Get all the counties in the 50 states and DC.gdf_counties=ced.download(
'acs/acs5', 2020, ['NAME'], state=ALL_STATES_AND_DC, county='*',
with_geometry=True
)
print(f"pyproj.__version__ = {pyproj.__version__}")
cProfile.run("gdf_counties.to_crs(epsg=9311)", sort='time')
Problem description
When I run these, the bulk of the run time is spent in pyproj._transformer._Transformer._transform. In the 3.4.1 case it is 0.335 seconds and in 3.5.0 it is 75.181 seconds. That's a slowdown of 224 times.
Notice that in both case the bulk of the run time is spent in pyproj._transformer._Transformer._transform. But in the 3.4.1 case it is 0.335 seconds and in 3.5.0 it is 75.181 seconds. That's a slowdown of 224 times.
This is a big enough difference that it makes the censusdis.maps.plot_us function so slow that it is painful for users of censusdis.
Environment Information
Python 3.9, pyproj 3.4.1 and 3.50, on a
2021 MacBook Pro with an M1 Max processor and 64GB of
RAM.
Installation method
I used poetry, but plain pip should work fine too.
The text was updated successfully, but these errors were encountered:
I believe there has been a performance regression from 3.4.1 to 3.5.0.
There are more details and a small repro at https://github.com/vengroff/pyproj-perf.
Code Sample
This code appears in
repro.py
in the repo mentioned above. But you can also copy and paste it from here if you wish. You should run it in a virtual env with Python 3.9 and censusdis 0.12.3, which will pull in pyproj 3.4.1. The profiling should run in under a second. But if you upgrade to pyproj 3.5.0 it will take much longer.Problem description
When I run these, the bulk of the run time is spent in
pyproj._transformer._Transformer._transform
. In the 3.4.1 case it is 0.335 seconds and in 3.5.0 it is 75.181 seconds. That's a slowdown of 224 times.See output files https://github.com/vengroff/pyproj-perf/blob/main/perf-3.4.1.txt and https://github.com/vengroff/pyproj-perf/blob/main/perf-3.5.0.txt for details.
Expected Output
I expected upgrading to 3.5.0 to not cause any noticeable performance differences from 3.4.1. But what I saw was
If you compare the two, the 3.4.1 run looks something like
3.5.0 looks like
Notice that in both case the bulk of the run time is spent in
pyproj._transformer._Transformer._transform
. But in the 3.4.1 case it is 0.335 seconds and in 3.5.0 it is 75.181 seconds. That's a slowdown of 224 times.This is a big enough difference that it makes the
censusdis.maps.plot_us
function so slow that it is painful for users ofcensusdis
.Environment Information
Python 3.9, pyproj 3.4.1 and 3.50, on a
2021 MacBook Pro with an M1 Max processor and 64GB of
RAM.
Installation method
I used poetry, but plain pip should work fine too.
The text was updated successfully, but these errors were encountered: