15
submitted 11 months ago by van2z@programming.dev to c/rust@programming.dev

For some reason, it seems popular for GUI crates to use the GPU. I just want to make simple widgets, for like a calculator.

No fancy graphics. I want it quite lightweight.

For some reason, popular GUI crates love to do everything through a GPU, which bumps up the memory / cpu use significantly.

top 10 comments
sorted by: hot top controversial new old
[-] RunAwayFrog@sh.itjust.works 13 points 11 months ago

Funny you should mention that. I think iced as of four days ago can do this!

If I'm reading the release notes and Cargo.toml right, cargo add iced --no-default-features and you should be good to go, as tiny-skia will be used as a rendering backend instead of wgpu.

[-] van2z@programming.dev 13 points 11 months ago* (last edited 11 months ago)

OMG, thank you! I have been using Iced. My simple application's RAM just went down from 80 MB to only 4 MB.

The executable size went down from about 8 MB to 2.5 MB

[-] hch12907@programming.dev 3 points 11 months ago

8MB to 2.5MB is a huge drop. I wonder what caused the bloat - a crate?

[-] Lmaydev@programming.dev 6 points 11 months ago
[-] hch12907@programming.dev 2 points 11 months ago

Obviously.

I mean the specific crate that caused the bloat.

[-] hunger@programming.dev 10 points 11 months ago

Slint fits the bill: We have a demo running on a line-buffer in a microcontroller with <300KiB of RAM. Framebuffers are of course supported as well, as is GPU-accelerated rendering.

[-] BB_C@lemm.ee 5 points 11 months ago

Did you tick "Bot Account" by accident?

[-] hunger@programming.dev 5 points 11 months ago

I did tick that, since I saw text boxes and went "give me everything" without reading:-)

Fixed. Thank you for pointing this out.

[-] BlueToo@lemmy.world -1 points 11 months ago
[-] spikespaz@programming.dev 2 points 11 months ago

You have much to learn Young Padawan. If you're wanting to make a desktop app in Rust it behooves one to avoid embedded web environments. For performance reasons of course.

this post was submitted on 01 Aug 2023
15 points (100.0% liked)

Rust

5390 readers
8 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 1 year ago
MODERATORS