question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Performance on polygon’s edge is slow

See original GitHub issue

I 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:closed
  • Created a year ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ringsaturncommented, Aug 20, 2022

Impressive performance improvements even without Numba!

image

https://ringsaturn.github.io/tz-benchmark/

1reaction
jannikmicommented, Aug 15, 2022

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found