gtk-rs / gtk-rs-core

Rust bindings for GNOME libraries
https://gtk-rs.org/gtk-rs-core
MIT License
272 stars 104 forks source link

glib: Don't use `g_object_list_properties()` for setting properties #1376

Closed sdroege closed 2 months ago

sdroege commented 2 months ago

Listing all properties of a type needs to iterate over every single pspec that is registered in the process, which is rather slow. In comparison, finding a specific property for a type only requires one or at most number of class hierarchy depth hash table lookups.

Fixes https://github.com/gtk-rs/gtk-rs-core/issues/1366

sdroege commented 2 months ago

This makes object construction about 30% faster after GTK is initialized.