• Christian Hergert's avatar
    utils: avoid use of rodata for string conversion speedup · b8229fc6
    Christian Hergert authored
    The rodata version is faster, but this version is close enough that it
    warrants not having the large amount of rodata included in the overhead.
    
    This caches the previously generated string and tries to handle the common
    case of sequential printf() by incrementing the last character. If that
    overflows, we walk towards the start of the string until we do not need
    to overflow.
    
    This is still roughly 20x faster than using sprintf() directly, as we did
    previously, for sequential strings.
    b8229fc6
gtksourceutils.c 12.4 KB