aboutsummaryrefslogtreecommitdiffstats
path: root/src/dbusbind.c
diff options
context:
space:
mode:
authorPaul Eggert2017-09-26 16:31:57 -0700
committerPaul Eggert2017-09-26 16:36:43 -0700
commit0e82fa34163dba21121e3a9cffa7f896c81c4d93 (patch)
tree16c728aa616dae256d429060e257313dcfe4dbde /src/dbusbind.c
parent98a37e60142340b9c2b4e6b17c373f4ae6a2d8b4 (diff)
downloademacs-0e82fa34163dba21121e3a9cffa7f896c81c4d93.tar.gz
emacs-0e82fa34163dba21121e3a9cffa7f896c81c4d93.zip
Avoid some unnecessary copying in Fformat etc.
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.
Diffstat (limited to 'src/dbusbind.c')
-rw-r--r--src/dbusbind.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dbusbind.c b/src/dbusbind.c
index 4a7068416fe..789aa008611 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -237,7 +237,8 @@ static char *
237XD_OBJECT_TO_STRING (Lisp_Object object) 237XD_OBJECT_TO_STRING (Lisp_Object object)
238{ 238{
239 AUTO_STRING (format, "%s"); 239 AUTO_STRING (format, "%s");
240 return SSDATA (CALLN (Fformat, format, object)); 240 Lisp_Object args[] = { format, object };
241 return SSDATA (styled_format (ARRAYELTS (args), args, false, false));
241} 242}
242 243
243#define XD_DBUS_VALIDATE_BUS_ADDRESS(bus) \ 244#define XD_DBUS_VALIDATE_BUS_ADDRESS(bus) \