← Back to context

Comment by kvemkon

21 hours ago

> GTK4

After my comment https://news.ycombinator.com/item?id=49235430 I've investigated the high RAM jump issue a bit further. It turned out, 60 MB comes from MESA / video graphics driver, right after the first function call, that triggers OpenGL/... context initialization. Thus:

  GTK2 14 MB
  GTK3 24 MB
  GTK4 38 MB  (+ 60 MB video acceleration)

Looks a bit better. But we still need 98 MB total.

Maybe we should also ask ourselves why modern native apps need OpenGL when you used to get by with a framebuffer. You can do more things with OpenGL but are you actually doing those things?

  • It's almost entirely about screen resolutions. In the Turbo Pascal era the screen probably had 640x480 pixels or 307,200 pixels in total. The screen I'm looking at now is 5120x2880 = ~14.7M pixels.

    If an app is maximized it has to render ~48x more pixels per frame, probably with anti-aliased text which older systems didn't use. Doing that on the CPU is not only visibly slow in many cases, but a waste of CPU time that could be better used for actual app logic. OpenGL happens to be a convenient and portable way to get the GPU to do work for you, at the cost of some memory, so GL it is.