Skip to content

Various fixes, 10x installation size reduction#29

Merged
halfmexican merged 4 commits intohalfmexican:mainfrom
v1993:fixes
Sep 12, 2025
Merged

Various fixes, 10x installation size reduction#29
halfmexican merged 4 commits intohalfmexican:mainfrom
v1993:fixes

Conversation

@v1993
Copy link
Contributor

@v1993 v1993 commented Aug 26, 2025

I felt a degree of responsibility to fix at least some of this upon stumbling across it...

  • Make the Flatpak file build from local source since that's what you want during development and CI
  • Don't include the Vala SDK extension since Vala is already included in the GNOME runtime
  • Reduce the installation size by about 10x (84MB -> 8 MB) by utilizing GLib resources compression for the emoji metadata file
  • Use the included method for loading JSON data from stream, avoiding loading the entire source file into memory at once
  • Eliminate the using statement and use namespaces directly - thankfully, this one was already mostly done

My next suggestion would be to avoid storing the JSON data (data_object and supported_emojis) in its original form long-term and instead pack it on loading into a more specific data structure to reduce memory consumption. I'm not down for this level of rewrite myself right now. Also, YAML is IMO much nicer for Flatpak manifests, but that's personal, and thus I haven't touched that.

v1993 added 4 commits August 26, 2025 22:53
Additionally, remove the Vala runtime extension.
It is already included in the Gnome runtime.
Dramatically reduces size of the final installation (84MB -> 8MB).
Use namespaces explicitly instead.
@halfmexican halfmexican self-assigned this Sep 11, 2025
@halfmexican
Copy link
Owner

halfmexican commented Sep 11, 2025

Thank you so much for the changes! I've been on a work trip. You're doing some much needed clean up and getting around to some things I should've done sooner 😅

JSON is less than ideal and wanted to use something else for this project, but was advised to start with JSON for simplicity.

Thanks again for your excellent contributions and the detailed explanation. This is a significant improvement!

@v1993
Copy link
Contributor Author

v1993 commented Sep 11, 2025

It's been a bit, but from what I remember, the JSON file also probably could be cut down by a fair bit: I don't think all of the data contained in it is actually used, you can freely convert between emojis and their code points, and all of the URLs share the same beginning.

@halfmexican halfmexican merged commit f0ccb46 into halfmexican:main Sep 12, 2025
1 check passed
@brog45
Copy link

brog45 commented Dec 22, 2025

Hello. I'm curious: Why were you eliminating the using statements?

@v1993
Copy link
Contributor Author

v1993 commented Dec 22, 2025

Hello. I'm curious: Why were you eliminating the using statements?

Mostly to be more explicit and avoid ambiguity - for example, there are HashSet classes both in GLib and Gee, Application in GLib, Gtk, and Adwaita, and it's completely unobvious from the name ArrayForeach that it is to be used with JSON arrays. Additionally, a fair bit of using statements were already unused (something vala-language-server should ideally catch).

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.

3 participants