param-parse: use g_string_append_c instead of g_string_append_printf
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 19 Nov 2019 16:22:42 +0000 (11:22 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 20 Nov 2019 16:00:29 +0000 (11:00 -0500)
commit8758b315fbf47af183388037f910d557c9b66d3d
tree51a510c7aa1f89370c73514df9f9bb179839c445
parent44e2e039eb4bea7100896f504f6e6a40b20b6a1e
param-parse: use g_string_append_c instead of g_string_append_printf

... to append a single character.

I did some tests to evaluate the performance impact of this patch, in
terms of number of instructions.  I ran the following command line 20
times and computed the average and standard deviation of the number of
execution instructions.

    $ libtool --mode=execute perf stat -e instructions:u ./src/cli/babeltrace2 query -p 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=2,' src.ctf.fs yo

                     average     stdev
Without this patch:  1079692     51
With this patch:     1039197     51

This represents a reduction of 3.75% in the number of executed
instructions.

Change-Id: I8109d42d0fa357e47642132a2f3b9581d72bcefa
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2403
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
src/param-parse/param-parse.c
This page took 0.026016 seconds and 4 git commands to generate.