Post AUHX0W0syscYTagz56 by hergertme@fosstodon.org
 (DIR) More posts by hergertme@fosstodon.org
 (DIR) Post #AUCDrePlVRND0TabSq by charadon@mb.iotib.net
       2023-04-01T03:56:20Z
       
       1 likes, 1 repeats
       
       So, today was my first day #programming with #GTK 4.My opinion on it: It's decent. It's got some annoyances, mostly in older useful widgets from GTK3 being removed when they probably could've just been abstracted to use the new "correct" methods. Another thing I noticed is that it uses so much more RAM than GTK3. My grpmi program on GTK3 used 6mb, but now it uses 100MB. Quite the jump.#linux #foss
       
 (DIR) Post #AUCFaF66a5bDTMDisa by charadon@mb.iotib.net
       2023-04-01T04:15:51Z
       
       0 likes, 0 repeats
       
       Oh, and I forgot to mention that GTK 4 fixed an issue where it couldn't handle a bunch of text without crashing. So that's neat
       
 (DIR) Post #AUCN4iPGsGbUjvf9HM by scarlet@bae.st
       2023-04-01T05:40:53.991767Z
       
       0 likes, 0 repeats
       
       @charadon @charadon >more than 10x resource usage>it's decentThose 2 statements are incompatible. By that metric I'd evaluate GTK4 as utter crap.
       
 (DIR) Post #AUCNoZ51skfn8R3cw4 by hergertme@fosstodon.org
       2023-04-01T05:49:00Z
       
       0 likes, 0 repeats
       
       @charadon how did you calculate this? Where memory shows up is not exactly equivalent now that you do GPU rendering. The memory maps can show up in different places even though fundamentally they are similar, especially with regard to anonymous pages.
       
 (DIR) Post #AUCO1QbWhrEOc1OKjw by charadon@mb.iotib.net
       2023-04-01T05:49:26Z
       
       0 likes, 0 repeats
       
       @scarlet@bae.st Well, it's ram usage is an odd situation. I know that unlike previous versions GTK4 is using OpenGL. Which means it'll be using more Shared Memory. So I have no idea how much of that is "Real" memory usage. Not to mention the performance improvements over GTK3 are pretty significant.
       
 (DIR) Post #AUCO7iCsArF2wUr9SS by charadon@mb.iotib.net
       2023-04-01T05:50:31Z
       
       0 likes, 0 repeats
       
       @hergertme@fosstodon.org Just whatever my system monitor says. shrugsI do know about the GPU rendering, so I do question how much is Shared Memory vs Actual Memory usage.
       
 (DIR) Post #AUCTurB073PEiqEZTU by hergertme@fosstodon.org
       2023-04-01T06:53:05Z
       
       0 likes, 0 repeats
       
       @charadon that’s going to be driver specific, and display server specific.If anything, gtk4 has the potential to be significantly less with using proper designs for lists/etc even with more objects used in wodgetry.
       
 (DIR) Post #AUDT8TdmVeCuz9aR3A by orbifx@mastodon.social
       2023-04-01T08:27:19Z
       
       0 likes, 0 repeats
       
       @charadon shame to hear about the extra memory use of #gtk4 I was sceptical about GTK4's dependency on #meson and #ninja, stayed with #GTK3 for now.@hergertme
       
 (DIR) Post #AUDT8UIY44oj1aezaq by charadon@mb.iotib.net
       2023-04-01T18:22:23Z
       
       0 likes, 0 repeats
       
       @orbifx@mastodon.social @hergertme@fosstodon.org Should be noted that the extra memory usage may not be "real" memory usage, but actually "shared" memory.
       
 (DIR) Post #AUDVBdFxPlgXaL4jUO by orbifx@mastodon.social
       2023-04-01T18:46:23Z
       
       0 likes, 0 repeats
       
       @charadon if it's got nothing to share it with, then still real :)@hergertme
       
 (DIR) Post #AUGV266JtonNchtuZk by hergertme@fosstodon.org
       2023-04-02T04:13:08Z
       
       0 likes, 0 repeats
       
       @orbifx @charadon it can be opportunistic vram backing to GPU.
       
 (DIR) Post #AUGV26ozDkWZrEnaCG by hergertme@fosstodon.org
       2023-04-02T04:13:45Z
       
       0 likes, 0 repeats
       
       @orbifx @charadon read up on how dmabuf works with mesa for the details.
       
 (DIR) Post #AUGV27tHFHYDApoWWW by hergertme@fosstodon.org
       2023-04-03T04:53:15Z
       
       0 likes, 0 repeats
       
       @orbifx @charadon This turned out to be even better than I thought. Simple GTK template from Builder, on GTK 3 vs GTK 4.GTK 3 => 98.3 MB in allocationsGTK 4 => 13.6 MB in allocations86% reduction in memory usage for even that simple couple window/dialog test case, let alone the more complex list-based type applications where you'd see even more by using GtkListView/GridView/etc.
       
 (DIR) Post #AUGV28SN8ncivgEYE4 by charadon@mb.iotib.net
       2023-04-03T05:27:36Z
       
       0 likes, 0 repeats
       
       @hergertme@fosstodon.org @orbifx@mastodon.social My basic program is still way above gtk3 in terms of memory usage (I subtracted the shared memory usage). Basically 50MB vs 6mb.I dunno, maybe it's something with vala
       
 (DIR) Post #AUGZmxNQYJjJzdVCmO by hergertme@fosstodon.org
       2023-04-03T06:22:03Z
       
       0 likes, 0 repeats
       
       @charadon @orbifx I would start by compiling your application with frame-pointers and run sysprof/valgrind/heaptrack/etc on it. It will literally tell you exactly where the issue is.That said, I'm certainly not a fan of Vala, but I doubt vala itself is the problem, if anything it would be the bindings not doing the right thing/proper handling of transfer notation, etc.That does happen, but it's certainly not GTK 4 that would be fundamentally broken or anything.
       
 (DIR) Post #AUGamD7SdXfCTxF5Bg by charadon@mb.iotib.net
       2023-04-03T06:32:00Z
       
       0 likes, 0 repeats
       
       @hergertme@fosstodon.org @orbifx@mastodon.social Yeah, it might be the GTK4 binding. I should compile it in a Arch VM with the latest vala and see if it's better.On the note of vala, I love it personally, as it's extremely portable, I like how it does objects much better than C++, and using GTK in it is fantastic compared to using GTK in C, where I wanted to end my existence =P
       
 (DIR) Post #AUGqQmvkPTouRaZQS8 by orbifx@mastodon.social
       2023-04-03T09:28:30Z
       
       0 likes, 0 repeats
       
       @charadon Ah, yeah, Vala's memory managment probably takes some extra memory.Which is why I like C and the syntax too. Don't like Java-y syntax and putting everything in classes.@hergertme
       
 (DIR) Post #AUHX0Ues1FPsH1Nt7w by orbifx@mastodon.social
       2023-04-03T09:33:39Z
       
       0 likes, 0 repeats
       
       @hergertme so far my very simple GTK3 app is 5M@charadon
       
 (DIR) Post #AUHX0VF1qoL85AIlUG by hergertme@fosstodon.org
       2023-04-03T12:50:52Z
       
       0 likes, 0 repeats
       
       @orbifx @charadon this is total allocations, not max watermark.
       
 (DIR) Post #AUHX0W0syscYTagz56 by hergertme@fosstodon.org
       2023-04-03T12:53:51Z
       
       0 likes, 0 repeats
       
       @orbifx @charadon and if that isn’t obvious, I’ll take less allocator churn any day. Looking like you use less but cycling through new allocations is a perf killer. On this case, GTK 4 is better at both so worthwhile to check what you’re doing.
       
 (DIR) Post #AUHX0WqHtljn30k2CW by charadon@mb.iotib.net
       2023-04-03T17:24:30Z
       
       0 likes, 0 repeats
       
       @hergertme@fosstodon.org @orbifx@mastodon.social Out of curiosity, in the event of a low memory situation, does GTK4 release some of it's cache?
       
 (DIR) Post #AUJKB67n7CoeG90wV6 by hergertme@fosstodon.org
       2023-04-04T14:11:13Z
       
       0 likes, 1 repeats
       
       @charadon @orbifx there are hooks in glib for it, but also we drop things from texture atlases after a few frames of not being used (but that is vram backed anyway).