NetworkManager/shared
Thomas Haller 09dcb18381 shared: use NMStrBuf in _nm_utils_enum_to_str_full()
Just for showcase and to hit the code from the unit-tests
that we have.

Also, just to show, the following runs about 25 % faster than before,
which isn't bad for such a simple replacement.

    {
         GType gtype = nm_test_general_color_flags_get_type ();
         const int N_RUN = 1000000;
         int i_run;
         guint8 c = 0;

         for (i_run = 0; i_run < N_RUN; i_run++) {
              gs_free char *str = NULL;

              str = _nm_utils_enum_to_str_full (gtype, i_run % 10, ",", NULL);
              c += str[0];
         }
         return c % 3;
    }

$ perf stat -r 200 -B libnm-core/tests/test-general

Before:

 Performance counter stats for 'libnm-core/tests/test-general' (200 runs):

            204.48 msec task-clock:u              #    0.997 CPUs utilized            ( +-  0.53% )
                 0      context-switches:u        #    0.000 K/sec
                 0      cpu-migrations:u          #    0.000 K/sec
               267      page-faults:u             #    0.001 M/sec                    ( +-  0.05% )
       702,987,494      cycles:u                  #    3.438 GHz                      ( +-  0.54% )
     1,698,874,415      instructions:u            #    2.42  insn per cycle           ( +-  0.00% )
       410,394,229      branches:u                # 2006.970 M/sec                    ( +-  0.00% )
         1,770,484      branch-misses:u           #    0.43% of all branches          ( +-  0.40% )

           0.20502 +- 0.00108 seconds time elapsed  ( +-  0.53% )

After:

 Performance counter stats for 'libnm-core/tests/test-general' (200 runs):

            155.71 msec task-clock:u              #    0.996 CPUs utilized            ( +-  0.50% )
                 0      context-switches:u        #    0.000 K/sec
                 0      cpu-migrations:u          #    0.000 K/sec
               266      page-faults:u             #    0.002 M/sec                    ( +-  0.05% )
       539,994,118      cycles:u                  #    3.468 GHz                      ( +-  0.49% )
     1,116,016,733      instructions:u            #    2.07  insn per cycle           ( +-  0.00% )
       283,974,158      branches:u                # 1823.760 M/sec                    ( +-  0.00% )
         1,377,786      branch-misses:u           #    0.49% of all branches          ( +-  0.43% )

          0.156255 +- 0.000786 seconds time elapsed  ( +-  0.50% )
2020-04-03 11:31:12 +02:00
..
c-list license: Add license using SPDX identifiers to meson build files 2020-02-17 13:16:57 +01:00
c-rbtree license: Add license using SPDX identifiers to meson build files 2020-02-17 13:16:57 +01:00
c-siphash license: Add license using SPDX identifiers to meson build files 2020-02-17 13:16:57 +01:00
c-stdaux license: Add license using SPDX identifiers to meson build files 2020-02-17 13:16:57 +01:00
n-acd license: Add license using SPDX identifiers to meson build files 2020-02-17 13:16:57 +01:00
n-dhcp4 meson: merge branch 'inigomartinez/meson-license' 2020-03-28 12:45:19 +01:00
nm-glib-aux shared: use NMStrBuf in _nm_utils_enum_to_str_full() 2020-04-03 11:31:12 +02:00
nm-keyfile all: use nm_clear_g_free() instead of g_clear_pointer() 2020-03-23 11:05:34 +01:00
nm-libnm-aux clients: in debug builds randomly use sync init of NMClient for testing 2019-12-10 09:17:17 +01:00
nm-libnm-core-aux all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-libnm-core-intern shared: expose size of nm_ethtool_data array in header 2020-03-06 09:49:32 +01:00
nm-std-aux license: relicense "shared/nm-std-aux/nm-dbus-compat.h" under LGPL-2.1+ 2020-01-14 16:54:43 +01:00
nm-udev-aux shared/udev: don't use GIOChannel to watch plain file descriptor 2020-01-13 15:46:04 +01:00
nm-utils shared/tests: add nmtst_get_rand_size() 2020-04-03 11:31:12 +02:00
systemd systemd: merge branch systemd into master 2020-03-23 17:50:12 +01:00
meson.build license: Add license using SPDX identifiers to meson build files 2020-02-17 13:16:57 +01:00
nm-default.h libnm: include "nm-libnm-utils.h" by default in libnm sources 2019-10-18 22:09:18 +02:00
nm-meta-setting.c libnm-core,cli: add VRF setting 2020-01-14 09:49:01 +01:00
nm-meta-setting.h libnm-core,cli: add VRF setting 2020-01-14 09:49:01 +01:00
nm-test-libnm-utils.h libnm/tests: extend nmtstc_client_new() to create other GObject types 2020-01-28 10:54:14 +01:00
nm-test-utils-impl.c libnm/tests: cleanup add_device_common() test helper 2020-01-28 10:54:14 +01:00
nm-version-macros.h.in release: bump version to 1.23.0 (development) 2019-11-29 15:46:22 +01:00