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

Performance Issues of Hexed Country Polygons #160

Open
DannyYangPersonal opened this issue Oct 16, 2023 · 2 comments
Open

Performance Issues of Hexed Country Polygons #160

DannyYangPersonal opened this issue Oct 16, 2023 · 2 comments

Comments

@DannyYangPersonal
Copy link

Hello,

I hope everyone is doing great! I was wondering if people have tips on improving the performance when using the Hexed Country Polygons Globe. Our team has been interested in using this product, however, it seems unfeasible to use as the high burst of CPU causes users to not be able to scroll and temporarily lag the site heavily. It also does not help that this project can not be used asynchronously. Thus, we resided to turning antialias to false, using the hex resolution of 3, and using a margin value between 0 and 1. Even with these configurations, the performance is just not good enough to release to production. The page will still freeze and causes users to not be able to scroll and also cause custom animations to delay. This leads me to ask, has anyone been able to successfully improve the performance of using the Hexed Country Polygons globe, and if they did, could they please remark some tips.

Thanks and take care everyone!

@BangNguyen1992
Copy link

Hello @DannyYangPersonal, in my opinion, you can try to use the useCallback such as below

Hope this help

        hexPolygonsData={HEX_DATA}
        hexPolygonResolution={useCallback(() => 3, [])}
        hexPolygonMargin={useCallback(() => 0.7, [])}
        hexPolygonAltitude={useCallback(() => 0, [])}
        hexPolygonColor={useCallback(() => COUNTRY_DOT_COLOR, [])}

@DannyYangPersonal
Copy link
Author

Hi @BangNguyen1992 ,

Thanks for the comment! Our team decided to create a scratch solution as this library is unfeasible for performant loading. We even tried with a hexPolygonResolution of 2 and many countries, such as South Korea, are out of place causing this library to be inoperable.

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

No branches or pull requests

2 participants