Skip to content

Implement zstd compression and PNG optimization - #162

Open
dankmeme01 wants to merge 1 commit into
mainfrom
package-size-optimization
Open

Implement zstd compression and PNG optimization#162
dankmeme01 wants to merge 1 commit into
mainfrom
package-size-optimization

Conversation

@dankmeme01

Copy link
Copy Markdown
Member

Loader v5.9.0 added support for unzipping Zstd entries in archives, so the new flags are gated behind target Geode version being v5.9.0 or higher. mod.json is always deflated, so older Geode versions can read metadata in a .geode file with no problems.

The new --zstd flag applies to geode package new (local builds, intermediary single-platform CI builds) to apply level 3 Zstd compression and to geode package merge to apply level 18 compression. Level 3 is the default level and is good for development/intermediary artifacts, while level 18 takes a lot more time and is good for release builds.

For example, stats for the Globed DLL:

  • 17.5 MiB uncompressed
  • 5.6 MiB with default Deflate
  • 5.1 MiB with Zstd level 3
  • 4.1 MiB with Zstd level 18

Zstd absolutely stomps the competition by being smaller and faster to compress on low levels. High levels shine with reduced sizes and still blazing fast decompression speeds (level 18 will still be unzipped much faster than regular deflate, so faster mod load times)

On top of that, oxipng is now used to more efficiently compress .png files in the final merged mod, if the --optimize-pngs flag is passed. This yields pretty significant size improvements yet again, at the cost of taking some extra time (for example Globed resources go from 9.1 MiB to 7.2 MiB). The compression is lossless and has no negative impact on texture load time.

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.

1 participant