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

Shrink reprs #12

Merged
merged 1 commit into from
Nov 14, 2022
Merged

Shrink reprs #12

merged 1 commit into from
Nov 14, 2022

Conversation

aazuspan
Copy link
Owner

Shorten CSS class names and remove unused classes to shrink HTML repr size as much as practical. Based on the benchmark below, I was able to drop repr size by about 30%!

obj = ee.ImageCollection("COPERNICUS/S2_SR").limit(1000)
rep = obj._repr_html_()
mb = len(rep) / 1e6
mb 
# Before changes: 68.84692
# After changes: 48.22587

I could have dropped another ~3% off the file size by setting type='checkbox' on the <input> elements within the JS instead of the HTML, but that seemed too weird, and I'm hoping to drop the JS script and go pure CSS in the future (pending new selector support, see #5).

Close #11

Shorten CSS class names and remove unused classes to shrink HTML
repr size as much as practical.
@aazuspan aazuspan added the performance Optimizations that affect perforrmance but not functionality label Nov 14, 2022
@aazuspan aazuspan merged commit 80ed21d into main Nov 14, 2022
@aazuspan aazuspan deleted the compress branch December 1, 2022 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Optimizations that affect perforrmance but not functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shrink reprs
1 participant