Performance on polygon’s edge is slow
See original GitHub issueI found that even toggle numba, lookup near edge is much slower than center.
pytest
pytest-benchmark
timezonefinder[numba]==6.0.2
from timezonefinder import TimezoneFinder
f = TimezoneFinder(in_memory=True)
f.timezone_at(lng=-0.17578125, lat=51.7814356044311)
f.timezone_at(lng=-5.033111572265626, lat=49.79988210788039)
def test_center(benchmark):
benchmark.pedantic(
f.timezone_at, kwargs={"lng": -0.17578125, "lat": 51.7814356044311}
)
def test_edge(benchmark):
benchmark.pedantic(
f.timezone_at, kwargs={"lng": -5.033111572265626, "lat": 49.79988210788039}
)
------------------------------------------------------------------------------------- benchmark: 2 tests -------------------------------------------------------------------------------------
Name (time in us) Min Max Mean StdDev Median IQR Outliers OPS (Kops/s) Rounds Iterations
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_center 29.0490 (1.0) 29.0490 (1.0) 29.0490 (1.0) 0.0000 (1.0) 29.0490 (1.0) 0.0000 (1.0) 0;0 34.4246 (1.0) 1 1
test_edge 121.8710 (4.20) 121.8710 (4.20) 121.8710 (4.20) 0.0000 (1.0) 121.8710 (4.20) 0.0000 (1.0) 0;0 8.2054 (0.24) 1 1
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Legend:
Outliers: 1 Standard Deviation from Mean; 1.5 IQR (InterQuartile Range) from 1st Quartile and 3rd Quartile.
OPS: Operations Per Second, computed as 1 / Mean
================================================================================= 2 passed in 0.74s ==================================================================================
Issue Analytics
- State:
- Created a year ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Polygon2D is extremely slow compared to Sprite rendering
Running the example project at 1x, polygon 2D was about 75% of the speed of sprites, but at 2x or higher the speed...
Read more >Postgis ST_Intersects performance - GIS Stack Exchange
Even with indexes, ST_Intersects() is slow when comparing polygons where one or more of them has a large number of vertices; I routinely...
Read more >Existence of vertex group significantly slow down select ...
If we have vertex group in object, selecting polygons, edges, vertex are significantly slower. If we remove vertex group performance of same operations...
Read more >Slow performance with python? - Esri Community
I'm working on a problem of spatially joining road edge vertices to the nearest road ... My problem is that the performance is...
Read more >How to Fix A Slow Microsoft Edge on Windows 10 and ...
1. Relaunch Microsoft Edge · 2. Update Edge · 3. Disable the "Preload New Tab Page" Option · 4. Change the Tracking Prevention...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Impressive performance improvements even without Numba!
https://ringsaturn.github.io/tz-benchmark/
@ringsaturn please check the new release 6.1.0 and see if it works (fast enough) for you even without Numba installed. I have now included a C extension for the point in polygon check algorithms which should get compiled automatically during the build.