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

Large Choropleths Cause Chrome to Crash #196

Open
jjkohler opened this issue Dec 17, 2020 · 6 comments
Open

Large Choropleths Cause Chrome to Crash #196

jjkohler opened this issue Dec 17, 2020 · 6 comments
Assignees
Labels
high-priority Refactor Refactor Branch Specific

Comments

@jjkohler
Copy link
Collaborator

https://staging.earthtime.org/explore#waypoints=1heLmeuPp7j4itr0cK8H4chugOpp7cU8p_VEB9CFfPlY.0&#v=152795,364832,1994398,1400734,pts&t=0&ps=50&l=maddison_project_cgdppc,bdrk,WITS_Deficits_US_all_products&bt=19910101&et=20161231&startDwell=0&endDwell=1&fps=30

You will see your Chrome tab crash after a few seconds.

You will only see red and black bubbles, but what is missing from what
you see is that there is actually a third layer loading behind the
scenes. And this layer is a giant chorolpleth layer: maddison_project_cgdppc

This layer's time range covers 1800 to 2016 and Chrome will crash. We have a couple
dozen or so of these large choropleths that will crash Chrome, but not
another browser like FireFox. The reason for this
is that Chrome has a max heap size of ~1GB and we exceed this when
loading a layer like this. FireFox, on the other hand, has a larger
default heap size and thus does not crash. Our binary choropleths method
(or mapbox) is the only solution.

Or decrease detail of the layer.

Current proposed fix by @rsargent is to decrease the geojson complexity

@jjkohler jjkohler added the Refactor Refactor Branch Specific label Dec 17, 2020
@jjkohler
Copy link
Collaborator Author

jjkohler commented Dec 17, 2020

@rsargent
Copy link
Member

layer maddison_project_cgdppc (top waypoint 140)
From https://api.earthtime.org/layer-catalogs/1rCiksJv4aXi1usI0_9zdl4v5vuOfiHgMRidiDPt1WfE.870361385/layers/maddison_project_cgdppc:

URL: https://docs-proxy.cmucreatelab.org/spreadsheets/d/1he-IZyCoMkhxUS3VRSSeQiW2lt5DBkufckMtT1BHnfs/export?format=csv&gid=450088725

Years 1, 730, 1000, 1150, then 1280-2016. Lots of columns

geojson appears to be the default per-country geojson

@pdille
Copy link
Contributor

pdille commented Dec 17, 2020

I mention this awhile back in issue #110

Decreasing geometry detail or using binned choropleths are the solution.

@pdille
Copy link
Contributor

pdille commented Dec 17, 2020

Also, I'm not sold on lowering the detail of the geometry as a fully encompassing solution here. How much do we know to cut on the detail for the different layers? Some span dozens of frames. Some more, some less. Do we have to keep lowering details as the dataset gets larger and larger? I have at least one layer that is for every country in the world and every month I add more data to it (school closure policies).

This is where the binned choropleths were something I was hoping to explore more.

@rsargent
Copy link
Member

We could also temporarily switch to bubbles for the large layers until we in the future either switch to binary or mbtile choropleths.

An advantage to a temporary solution like this is that we fix both staging and production without needing to port the feature.

@rsargent
Copy link
Member

Gabriel suggests porting JSON choropleths to use shaders that were developed for binary-tile, as they're much more memory efficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high-priority Refactor Refactor Branch Specific
Projects
None yet
Development

No branches or pull requests

4 participants