Post B9Yd5hoCNLrY5WhNq4 by YaLTeR@mastodon.online
 (DIR) More posts by YaLTeR@mastodon.online
 (DIR) Post #B9Yd5hoCNLrY5WhNq4 by YaLTeR@mastodon.online
       0 likes, 1 repeats
       
       pov: writing a custom scrollable widget
       
 (DIR) Post #B9cocvsgazMqd6VuIy by YaLTeR@mastodon.online
       0 likes, 1 repeats
       
       My experiment to write a custom GtkScrollable instead of GtkColumnView to get rid of a bunch of widget performance overhead.All of these are still real PangoLayouts (which take a while to layout). But no per-cell CSS (slow) and per-cell signal item bind/unbind (slow) and gtk_label_set_text (apparently also slow, adds up). I also plan to make it keep the scroll pos on reload (a bit broken in ColumnView).---sorry, should've titled this "i rewrote my rust app in zig and it became 5x faster 🚀"
       
 (DIR) Post #BABpO82iAh1teK21hY by YaLTeR@mastodon.online
       0 likes, 0 repeats
       
       Well, after playing around with Zig (final version at [1]), my opinion is that while Zig is fun and nice for producing clean optimized assembly and custom allocation patterns (and will improve my Rust code going forward), having to keep track of all the cleanup does take up a disproportionate part of my brain, and I do frequently make memory mistakes.To conclude I wrote the same custom table widget in the Rust version, and it's ~as fast as the Zig one, as expected.[1] https://github.com/YaLTeR/tas-log-reader/tree/zig
       
 (DIR) Post #BABpO8J1C44cStf37Q by YaLTeR@mastodon.online
       0 likes, 1 repeats
       
       So, this data table widget manages random scrolling at ~120 FPS. The main hotspots:- 49% pango layout| - 24% harfbuzz shaping (arguably useless here -- I only care about ASCII and digits)| - 7.2% line breaking (useless here)| - 7% itemization- 23% gtk_snapshot_append_layout| - 14.6% gsk_get_glyph_string_extents (lots of font map reloading here for some reason even tho it's the same few characters?)- 14% gsk_render_render| - 6.9% gsk_gpu_node_processor_process
       
 (DIR) Post #BABpO9JlQmGRbV19v6 by YaLTeR@mastodon.online
       0 likes, 0 repeats
       
       (btw I completely forgot about Hotspot and it's such an amazing application. lets you do all kinds of filtering on the perf data)https://github.com/KDAB/hotspot