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 binaries #654

Open
deifactor opened this issue Oct 10, 2020 · 0 comments
Open

Large binaries #654

deifactor opened this issue Oct 10, 2020 · 0 comments
Labels
bug Some API breaks the contract it establishes help wanted PR's would be appreciated subsystem-graphics

Comments

@deifactor
Copy link

Describe the bug
A simple program using quicksilver generates a 23MB binary whose rodata consists mostly of null bytes.

To Reproduce

Compile the following on --release:

use quicksilver::{
    graphics::{Graphics, VectorFont},
    input::Input,
    Result, Settings, Window,
};

async fn app(window: Window, gfx: Graphics, mut input: Input) -> Result<()> {
    let font = VectorFont::from_bytes(vec![]);
    font.to_renderer(&gfx, 12.0)?;
    Ok(())
}

fn main() {
    quicksilver::run(Settings::default(), app);
}

If I take out the to_renderer call, the size drops to a more reasonable 6 MB. I think this is happening because the CACHE_DATA static is getting shoved inside the file's .rodata, since if I put my own 4M-entry static array in the binary (and then read from it to prevent it from getting optimized out) the binary grows by another 16 MB.

Environment and versions (please complete the following information):

  • Environment: NixOS
  • Rust compiler version: 1.47
  • Quicksilver verison: 0.4.0-alpha0.7
@ryanisaacg ryanisaacg added bug Some API breaks the contract it establishes subsystem-graphics help wanted PR's would be appreciated labels Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Some API breaks the contract it establishes help wanted PR's would be appreciated subsystem-graphics
Projects
None yet
Development

No branches or pull requests

2 participants