gdbus-codegen: Generate signal marshallers for each interface signal

We relied on g_cclosure_marshal_generic() to easily generate signal
marshallers, but this relies on inspecting each parameter type with ffi
and this implies a performance hit, other than breaking the stack-frame
unwinder used by Linux perf and so by sysprof.

Given that we know the types we work on, it's easy enough to generate
the marshallers ourself.

Helps with: https://gitlab.gnome.org/GNOME/glib/-/issues/3028
This commit is contained in:
Marco Trevisan (Treviño)
2023-06-30 02:52:11 +02:00
parent 51c023f189
commit 1cd5c5678a
3 changed files with 201 additions and 19 deletions

View File

@ -114,6 +114,10 @@ def camel_case_to_uscore(s):
return ret
def uscore_to_camel_case(s):
return "".join([s[0].upper() + s[1:].lower() if s else "_" for s in s.split("_")])
def is_ugly_case(s):
if s and s.find("_") > 0:
return True