logoalt Hacker News

blackhaztoday at 5:33 PM8 repliesview on HN

10 MB is ridiculously overbloated. 1 MB or something in that vicinity should be more like it.


Replies

magackametoday at 7:00 PM

I think you guys on HN can be a bit out of touch maybe? On my linux machine (measured with tux-manager):

  nautilus                            177 MB
  kitty                               150 MB
  alacritty                           107 MB
  mpv --idle --force-window           160 MB
  winit empty window + OpenGL context 100 MB
  tux-manager                         69  MB
  hexchat                             55  MB
  gnome-terminal                      47  MB
  st                                  12  MB
  xterm                               12  MB
All these apps are what you would consider native, good apps. Written with Qt, GTK, some in low level langs like C\C++, Rust as well. There is of course different ways to measure the usage and maybe some more testing needs to be done, but stuff like 1-10 MB seems completely unrealistic. I think any empty Qt/GTK app eats 40 MB at least. Only thing that even gets close is st at 12 MB. And mind you it's a terminal (which is 1000x simpler than any modern GUI app, doesn't load any assets etc) and it doesn't even use any GPU accel (which itself seem to add a lot of baseline cost).

Honestly I was a bit surprised myself. I have a Rust winit + ash vulkan hardcoded triangle demo app and it eats 86 MB (the binary itself is 5.5 MB). I would love to know, if anyone could explain why GPU accel seems to eat up so much RAM. Like yeah, there are a bunch of images that live on swapchain, but they should all be in VRAM. Outside of that I don't see what would require MBs worth of overhead.

show 3 replies
binaryturtletoday at 7:19 PM

`ansiweather` needs like ~6.28 MiB (measured with `/usr/bin/time -l` on OS X), but it's a bash script that invokes cURL, so there's certainly various overheads there too.

One probably could get this down way below ~1 MiB with a properly tuned straight executable written in C (best not to use any of the "modern" stuff like Rust and Go, their default binary sizes for outputting "Hello, world!\n" are already extreme :-) )

By default anything needs at least 532480 bytes RSS on OSX (I tested it with the most minimal C hello world), so that's a threshold one probably can't beat on OS X at least. We probably could kill that value on Amiga OS with the exact same functionality. :-)

Const-metoday at 5:40 PM

10 MB is not too bad for a GUI app. If the app is full screen, display is FullHD and has 8 bit depth, that's almost 8 MB memory for the back buffer alone. Enable HDR and pixels become 8 bytes RGBA16_Float instead of 4 bytes BGRA8_Unorm, twice as much memory.

show 4 replies
david-gputoday at 5:36 PM

How much money are these companies going to make by reducing their weather app to 1MB, or 10MB? How much is it going to cost them to get there?

The world doesn't run on personal aesthetics, when nobody is willing to pay for them.

show 2 replies
guiambrostoday at 7:25 PM

Unrelated, but it reminds me of this C64 demo [1] I posted earlier this week: the whole thing in 17.8 KB.

[1] https://news.ycombinator.com/item?id=49205592

cdud3today at 5:50 PM

The KDE Plasma weather app takes in maximum 1MB.

show 1 reply
rpdillontoday at 6:14 PM

I mean, you're getting dumped on for this, but it seems about right?

For an extreme example:

    curl https://wttr.in/
Inside of a conky widget would do the trick, I think.

https://github.com/brndnmtthws/conky/wiki/Lua:-Shell-Integra...

show 1 reply
khazhouxtoday at 7:16 PM

Even 1MB is too much. I expect a modern weather app to be <20K.