16 ms·
This took me down a rabbit whole. Why can a simple single purpose app not be just a couple megabytes if not less? The popular options are electron 100MB+, or em
by firefoxd 1mo ago
This took me down a rabbit whole. Why can a simple single purpose app not be just a couple megabytes if not less? The popular options are electron 100MB+, or embedding python3 in your executable which is at least 40MB.
But if you build it natively, you should have all of Microsoft tools at your disposition, dlls and such. In theory, this should allow you to make a 1 mb app or less. But in practice, it's the worse option.
- trzy 1mo agoThe visual assets alone will be tens of megabytes.
- SV_BubbleTime 1mo agoDo all visual aspects of a weather app need to be loaded at once? Is the cost penalty loading a hundred kilobytes per image from disk really unacceptable?
- doikor 1mo agoEven if the app is no longer using that memory it is not released until Windows thinks another app needs it.
- vel0city 1mo agoAnd then people complain about how unresponsive applications are, all these little stutters as things pop in.
- mrheosuper 1mo agoOur storage can transfer Gigabytes of data, do hundred thousand operations every second. The hardware is more than capable. If your software stutter when streaming few hundred KBs of data, it's on you.
- vel0city 1mo agoBandwidth and latency are two different things. The latency of handling things in system memory is still pretty different than the latency of handling stuff on SSDs.
- mrheosuper 1mo agoStill, it should not be more than few miliseconds, it's solid state. Im pretty sure most of the latency come from the software.
- Micrococonut 1mo agoShould be able to get by with using system graphics
- anonymars 1mo agoWhy, though? You need some icons and some map imagery, not 4K texture maps
- iAMkenough 1mo agoFor a weather app, you should be able to get by with a couple base vectors you modify based on conditions.
- mort96 1mo agoOn disk yeah, sure. But you're gonna render them into a pixel buffer which lives in memory.
- samrus 1mo agoHow did applications do it before? Like in the 90s or 00s
- nicoburns 1mo agoThey had fewer graphics, and much lower resolution screens.
- Dylan16807 1mo agoWindows 98 SE kind of went overboard with the graphics (remember Active Desktop?), and a common screen size at the time was 1280x1024. But if you run modern stuff at 1080p (60% more pixels) or 720p (fewer pixels), you're not going to see comparable memory use.
- mort96 1mo agoWindows 98 wasn't composited, which makes a huge difference. And to be clear, there's a ton of unnecessary bloat today as well. It's just that even a lean and mean highly hand optimized native app is gonna be way bigger today than it was then, due to compositing, higher resolution assets, higher resolution screens and different design sensibilities. But most apps aren't lean and mean highly hand optimized native apps so.
- Dylan16807 1mo ago
- mort96 1mo agoPictures and frame buffers. If you're running fullscreen at 4k, you're probably gonna take two roughly 3840x2160x3 byte frame buffers for the window. Your designers want a background image which moves as you scroll in some parallax style; that's over 3840x2160x3 bytes more for the pixel buffer backing the image layer. And let's say roughly 50% of your screen is text with subpixel (aka full color) anti aliasing; that means another 3840x2160x3x0.5 bytes for the pre rendered text. 3840x2160x3x3.5. That's 87MB, in pixel data only. And it's a very minimal example; for the parallax image, you're gonna want the image to be significantly taller than the window; you're gonna want a ton of smaller (tho still high DPI) images for icons; a few different font atlases for different font faces you've loaded at once; maybe pre rendered pixel buffers for all sorts of UI components; etc. And lord help you if your designers want any part of this to be animated. (I'm playing a bit fast and loose with what lives on the GPU and what lives on the CPU here. On many systems, they share a memory pool anyway. But on systems with discrete GPUs, most of this is gonna be video memory. Though applications may wanna store CPU-side copies as well for various reasons.)
- 201984 1mo ago>Your designers want Sometimes, you need to tell the designers NO. Moving background images don't help people figure out what the weather is going to be.
- mort96 1mo agoHonestly if the image is of the current weather it kinda does. I don't mind e.g Apple's weather app design at all
- mrob 1mo agoYou probably have a SVG renderer in memory already, and you already have a frame buffer and/or compositor buffer(s). Why should adding a graphical representation of the weather require more than a few KiB?
- 1mo ago
- znpy 1mo agoIt can, but you have to know what you’re doing and you have to know it very well. Looking at the opposite extreme, the guy that originally wrote the windows task manager (the thing that popped put when you pressed ctrl+alt+canc) posted a video about cloning the windows basic text editor in a 3kb binary: https://youtu.be/OG91c7xsNMc https://youtu.be/OG91c7xsNMc Needless to say, the guy knows what he’s doing.
- ashleyn 1mo agoA lot of these applications run in Electron or similar libraries where a whole new browser instance, with all its overhead, is stood up for each application. The simplest answer is we need to stop trying to use web technologies as a one-size-fits-all GUI toolkit.
- fireant 1mo agoChromium is actually fairly efficient when shared across multiple applications. If the webview2, which is probably what the weather app uses, would not create a whole browser per application but rather just the renderer process and the rest shared system wide it would be a couple hundred megs at most.
- lelanthran 1mo ago> This took me down a rabbit whole. The rabbit was too hungry to even stop to chew you?
- fuzzfactor 1mo agoBeware the rabid rabbit and don't let your whole near his hole . . .
- firefoxd 1mo agoHaha, and it's far too late to edit!
- deleted 1mo ago[deleted]
- vrighter 1mo agoI embed lua when I need it. 200 to 400kb and we're off. And it's infinitely easier to interoperate with c than python is
- rk06 1mo agoit can be. you just need competence and incentive for it. see File pilot as an example of what is possible when competent software engineer attempts it