1. 34
  1.  

  2. 31

    LOL @ 100 MB being considered small. Just yesterday, I was working on my gui lib (which, granted, has zero mobile support, so totally unfair comparison.. but still) and I was like “eh, that 2.4 MB RAM usage is a little fat”.

    How low have standards fallen in the mobile world?

    1. 11

      This is the RAM their replacement for the Android simulator needs. So that’s including debugging/hot code swapping support, I suppose. I’d be interested in the non-debugging case.

      1. 8

        I’m skeptical: 2.4 MB of ram is barely enough to contain the pixels for a single 640x480 window with double buffering. While there’s the Flutter example could almost certainly use less memory, I think you’ve got some sort of accounting error here.

        1. 1

          I have a buffer for 500x500 there, since that was the window size in my test program, so that accounts for 1 MB… but that isn’t actually strictly necessary (and the operating system will have another for the desktop compositor, and the screen framebuffer itself, but those are on the OS side and thus is apples-to-apples on any user framework). You can redraw in response to the WM_PAINT messages too and avoid keeping the additional buffer. This isn’t an arcane technique - it is the way native desktop apps have basically always worked!

          My library is 150 KB, and actually uses native stuff so… that’s about all there is to it.

          1. 6

            You can redraw in response to the WM_PAINT messages too and avoid keeping the additional buffer. This isn’t an arcane technique - it is the way native desktop apps have basically always worked!

            You seem to be on Windows, so I want to clarify things a little bit:

            Yes, since Windows 7/Server 2008, Windows automatically keeps an off-screen buffer for you, and that’s what you’re actually drawing to when you respond to WM_PAINT. But (at least as of Windows 8) that buffer is subject to the same drawing rules that used to apply for direct screen rendering—specifically, if you’re drawing “directly” to the screen, then your double-buffered image can still sheer, giving you exactly the same artifacts you used to get on Windows 3.1 if you didn’t double-buffer.

            (If that has changed, I’m curious how. My guess is they would implicitly do buffer-swaps at the conclusion of handling WM_PAINT.)

            1. 1

              Well, what I meant there was you can just respond to the message and get a working program, but yeah, I use a bitmap buffer too and just blit that over to paint (and in the window size I had at the time, it was a ~1MB buffer).

              But this is a fraction of what flutter (and electron) devour.

        2. 5

          One big point of desktop apps is to not eat an imperial shit-ton of RAM, so this struck me too.

          Oh well, memory is relatively expensive so computers don’t ship with a lot of it, but people seem content with blowing it all on a browser and a browser-based app or two :(

          1. 1

            Well, RAM is plentiful… until you have 80 tabs. 80 * 1 MB is doable. 80 * 100 MB is suddenly memory pressure. And that isn’t that uncommon!

            1. 4

              Err… my ancient desktop, which is so old it barely has USB3, got 32G without breaking financial sweat. This back in the day, not current discount offers. But if I wanted to upgrade my current workstation up from 8G I’ll not only pay myself sick, but get in line to even buy anything.

              Thanks, mobile phones, for eating up the world’s DDR4 supply, I guess.

              Despite that, I’m a heavy user of tabs, famously sticking to an old and insecure browser for Tab Mix Plus + Tab Groups, until Mozilla unfucks its product.

              I don’t have nearly all tabs loaded and occasionally I shut down the browser.

              Not just to conserve memory but to keep me from being distracted while working with proper desktop apps.

              1. 4

                Ram isn’t exactly cheap today however. I recently bought some more ram for my pc, and it cost double what I paid for the same amount of ram 2 years ago. It’s jt that expensive, but often other parts get prioritized over more ram.

                1. 1

                  Err… my ancient desktop, which is so old it barely has USB3, got 32G without breaking financial sweat.

                  On Desktops you can upgrade, but laptops are a different story. I have 32GB in my ThinkPad X220, but I can’t just upgrade the 16GB MBP that I am typing on. Similar to my phone, where upgrading RAM is not possible either. I guess I need to throw it away now and buy a new one…

          2. 21

            What’s missing? A lot!

            Another thing that’s missing is support for accessibility on any desktop platform. This means, for example, that blind people can’t use Flutter-based desktop apps via screen readers. Please don’t use this for anything important until this problem is solved.

            1. 4

              This isn’t a reason to not not use Flutter for desktop apps right now, but I believe the a11y story for Electron apps is extremely poor too. :(

              Supposedly there’s some support, but AFAICT it’s slightly worse than Google Chrome’s, which is abysmal when I last tried it. I can’t remember details with any precision but I had a tiny Electron app that I’d written with just a tiny HTML form and a couple buttons (i.e. only barely bigger than hello world) and I remember trying to get it to be usable with NVDA + keyboard controls was just a complete bust.

              I think the HTML thing I’d written was WCAG-y enough - proper <button> elements for the clickable bits and so on rather than divs with onclick handlers, and so on. So when I open the HTML file that my tiny Electron app was embedding:

              • in MS Edge, I think I had no trouble getting NVDA to read the page out, navigate elements and use them.
              • in Chrome, haha, complete bust. I think it would only read out one <button> and totally ignore the <p> tags?

              As far as I can tell:

              • the Chrome team just don’t assign any programmer effort at all to exposing useful data to the Windows a11y APIs.
              • Firefox tries a bit but doesn’t do a perfect job :/
              • MSIE and MS Edge both work really nicely with NVDA. Clearly a tonne of effort has been put in here, because I can actually read real websites (e.g. BBC news, can’t remember if I tried lobsters 😉) when I tried using MS Edge + NVDA, despite having approximately no experience with using a screenreader (because I’ve never needed to).

              (edit: sorry if I got a bunch of details wrong, this was most of a year ago and I didn’t take detailed notes at the time)

              1. 3

                Interesting. For at least the past year and a half, NVDA has worked quite well with Chrome. And Electron apps can be fully accessible with NVDA, though of course not all of them are.

                1. 2

                  Hm. Doesn’t match what I saw when I tried it. I think it was early 2018 judging by the time stamp on the copy of NVDA lying around in my downloads folder.

              2. 5

                Please don’t use this for anything important until this problem is solved.

                Just because something isn’t useful for blind people, doesn’t make it useless.

                Most people in the world are not blind. You don’t need to cater to exactly 100% of people and all their idiosyncracies for a tool to be useful.

                1. 13

                  Don’t blindly assume that assistive technology support is exclusively for blind people.

                  Doing AT support right also subsumes a other things like the app’s usability by people who can’t currently use a mouse.

                  Think of “this doesn’t work for blind users” as a litmus test: if you can use it with your eyes closed, it’s fairly safe to say that very few people will be locked out of it.

                  You and I and every one of us are all at most one small explosion away from having eyesight bad enough to need a screen reader anyway.

                  1. 5

                    Maybe my plea was a bit too unconditional. After all, some applications are inherently visual and couldn’t be used by blind people no matter what GUI toolkit is used. But I don’t believe that’s most applications.

                    I know a blind person who almost lost his job because of an inaccessible application. Actually, he did lose his job, then the company hired him back because they found an entirely new role for him. Anyway, for a time, however brief, he was without a job, and had the emotions that come with that. So when I advocate for accessibility on a thread like this, I’m trying to prevent something like that from happening again.

                    1. 1

                      No, I think it’s actually totally reasonable. If it’s not usable for blind people it’s worse than useless, it’s a personal liability. One day I woke up and I couldn’t see the lightswitch on the wall 5 feet away from me. It was temporary, caused by eyestrain, however for many it’s not temporary. Requiring accessibility means you have it WHEN you go blind. Notice I said when, there is no if here. The only if is if you die first.

                2. 5

                  In the following Gif I recorded myself cold booting the emulator and running the default Flutter app. I took me a whopping 2 minutes and 40 seconds. Just image how much productive things could have happened during that time. What if I told you, you could be up and running in less than 10 seconds?

                  Close, but no cigar. While the author correctly realizes that software requiring over two minutes to start is unacceptable, he then makes the mistake of believing a mere ten seconds is acceptable. It’s not and there’s no excuse a multi-gigahertz machine should need more than even half a second for something so trivial. You can make the argument for diminishing returns and all of that, but at least get it under a second.

                  Last but not least: RAM. This is a pretty big deal for people working on notebooks and/or somewhat less beefy machines. The Android emulator eats up roughly 1GB of RAM. Now, imagine running two of those (testing a chat application or similar), IntelliJ, and the ever-RAM-hungry Chrome. That’s pretty heavy. Because the embedder is running natively, there is no need for Android. Which makes it much smaller. 100 MB of Ram for the native app

                  That’s not at all impressive. Just what is possibly being done with all of those tens of megabytes? The author doesn’t mention what, so it seems fair to argue he doesn’t even know.

                  In sum, this is nice to read for a laugh. It’s a competitor for Electron, sure, but that’s nothing worthwhile and it’s disconcerting to see something such as this being touted as lightweight and efficient.

                  Lastly, as is evidenced in just the text I quoted, this article is rife with very trivial spelling errors and there’s no excuse for that, either.

                  1. 7

                    “and it’s disconcerting to see something such as this being touted as lightweight and efficient.”

                    Where does it say that? It has a comparison to the the Android emulator and concludes that it is much smaller. It is. By a factor of 10x.

                    What is more, this seems to be some sort of debugging binary with “hot-reloading and debugging capabilities”. That means that you do not need to wait 10s after a code change.

                    I do not know but I imagine that the final binary would use significantly less RAM.

                    “It’s not and there’s no excuse a multi-gigahertz machine should need more than even half a second for something so trivial.”

                    Well, then make it fast. Complaining is easy and I think your tone is unnecessarily harsh.

                    1. 3

                      What is more, this seems to be some sort of debugging binary

                      Also the “10 seconds” figure is counted from the “run” button in the IDE, so it includes some of the app build (with warm cache, i.e. just checking that source code didn’t change)

                  2. 1

                    Flutter is like React Native? Using FRP for writing apps on any platform?