Coder Social home page Coder Social logo

Comments (2)

jshrake avatar jshrake commented on May 22, 2024

TLDR: I can bring the size of the release binary down to ~3.4 MiB by running strip, and following the advice in https://github.com/johnthagen/min-sized-rust.

Without doing anything, a release build weighs in at 4.6 MiB:

cargo bloat --release --crates --split-std -n 20
Compiling ...
Analyzing target/release/grimoire

 File  .text     Size Name
 6.7%  11.6% 318.1KiB clap
 6.6%  11.4% 312.7KiB core
 5.6%   9.6% 265.6KiB image
 4.8%   8.3% 229.2KiB regex_syntax
 4.6%   8.0% 220.3KiB regex
 4.4%   7.7% 210.8KiB alloc
 3.8%   6.5% 179.7KiB grimoire
 3.8%   6.5% 178.2KiB std
 3.7%   6.3% 174.1KiB toml
 1.9%   3.3%  90.1KiB notify
 1.7%   2.9%  79.0KiB serde
 1.4%   2.4%  65.2KiB jpeg_decoder
 1.3%   2.3%  62.0KiB inflate
 0.8%   1.4%  39.9KiB gleam
 0.7%   1.3%  34.6KiB scoped_threadpool
 0.7%   1.2%  32.2KiB [Unknown]
 0.7%   1.1%  31.5KiB env_logger
 0.6%   1.0%  27.7KiB png
 0.4%   0.7%  19.2KiB rustc_demangle
 0.4%   0.7%  18.8KiB rayon_core
58.0% 100.0%   2.7MiB .text section size, the file size is 4.6MiB

After running strip, 3.8 MiB:

~/code/grimoire 15s
❯ strip target/release/grimoire

~/code/grimoire
❯ ls -lh target/release/grimoire
-rwxr-xr-x  1 justin  staff   3.8M Mar 31 20:02 target/release/grimoire

Following the suggestions in https://github.com/johnthagen/min-sized-rust, I can bring the size down to ~3.4 MiB.

from grimoire-legacy.

jshrake avatar jshrake commented on May 22, 2024

Random thought: could we somehow use grimoire to emit an artifact that contains the exact set of GL calls + shader code required to render? code generation seems scary and out of scope for this project, but I highly doubt that we'll ever be able to shrink grimoire down to a suitable size for a 64k entry.

from grimoire-legacy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.