Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization in getEdgeHexagons #913

Merged
merged 2 commits into from
Sep 26, 2024
Merged

Optimization in getEdgeHexagons #913

merged 2 commits into from
Sep 26, 2024

Conversation

heshpdx
Copy link
Contributor

@heshpdx heshpdx commented Sep 26, 2024

Replace 4 fpdiv's with 1 fpdiv and 4 fpmul's.

I ran benchmarkPolygonToCellsExperimental and benchmarkPolygonToCells on my Ampere Altra, and here are the results. The Alameda geoloop is doing well at +5.5%.

benchmark old new ratio
polygonToCellsSF_Center 1651.815 1644.885 1.0042
polygonToCellsSF_Full 4763.64 4729.577 1.0072
polygonToCellsSF_Overlapping 5672.139 5646.54 1.0045
polygonToCellsAlameda_Center 3889.226 3686.52 1.0550
polygonToCellsAlameda_Full 9900.065 9650.448 1.0259
polygonToCellsAlameda_Overlapping 12840.43 12585.24 1.0203
polygonToCellsSouthernExpansion_Center 76209.64 76028.62 1.0024
polygonToCellsSouthernExpansion_Full 228112.8 226663.6 1.0064
polygonToCellsSouthernExpansion_Overlapping 370727.4 367403.3 1.0090
polygonToCellsSF 2804.544 2803.674 1.0003
polygonToCellsAlameda 4218.331 4215.235 1.0007
polygonToCellsSouthernExpansion 125736.6 125077.6 1.0053

Replace 4 fpdiv's with 1 fpdiv and 4 fpmul's
@coveralls
Copy link

coveralls commented Sep 26, 2024

Coverage Status

coverage: 98.825% (+0.001%) from 98.824%
when pulling 9a157d8 on heshpdx:hex_algo
into 4899d29 on uber:master.

@isaacbrodsky isaacbrodsky merged commit 9cc20fd into uber:master Sep 26, 2024
34 checks passed
@heshpdx
Copy link
Contributor Author

heshpdx commented Sep 27, 2024

Thank you! Also if you didn't see, Uber moved their services to Ampere servers in OCI cloud:
https://www.cio.com/article/3513933/uber-embraces-the-cloud-with-customized-cpus.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants