• Paul Eggert's avatar
    Avoid some unnecessary copying in Fformat etc. · 0e82fa34
    Paul Eggert authored
    This patch is just for performance; it should not affect behavior.
    On my platform, it made the microbenchmark (format "%S" load-path)
    run about 45% faster.  It should also speed up calls like (message
    "%s" STRING).
    * src/callint.c (Fcall_interactively):
    * src/dbusbind.c (XD_OBJECT_TO_STRING):
    * src/editfns.c (Fmessage, Fmessage_box):
    * src/xdisp.c (vadd_to_log, Ftrace_to_stderr):
    Use styled_format instead of Fformat or Fformat_message,
    to avoid unnecessary copying.
    * src/editfns.c (styled_format): New arg NEW_RESULT.
    All uses changed.  Reuse an input string if it has the
    right value and if !NEW_RESULT.
    * src/lisp.h (style_format): New decl.
    0e82fa34
dbusbind.c 54.8 KB