test UPDATE perf test improvements
diff --git a/README.md b/README.md
index 45ae6d7..3fb3373 100644
--- a/README.md
+++ b/README.md
@@ -222,13 +222,14 @@
There is a performance measurement tool included that prints information about
the time required to execute common use-cases of working with YANG instance data.
-To enable this test, use:
+To enable this test, use an option and to get representative results, enable Release build type:
```
-$ cmake -DENABLE_PERF_TESTS=ON ..
+$ cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_PERF_TESTS=ON ..
```
-and to run the test with seeing its output:
+and to run the test with seeing its output run:
```
-ctest -V -R ly_perf
+$ make
+$ ctest -V -R ly_perf
```
### Code Coverage
diff --git a/tests/perf/perf.c b/tests/perf/perf.c
index 127c9c6..d5a95ca 100644
--- a/tests/perf/perf.c
+++ b/tests/perf/perf.c
@@ -156,17 +156,17 @@
LY_ERR ret;
struct timespec ts_start, ts_end;
struct test_state state = {0};
- const uint32_t name_fixed_len = 37;
+ const uint32_t name_fixed_len = 38;
char str[name_fixed_len + 1];
uint32_t i, printed;
uint64_t time_usec = 0;
/* print test start */
printed = sprintf(str, "| %s ", name);
- while (printed + 1 < name_fixed_len) {
+ while (printed + 2 < name_fixed_len) {
printed += sprintf(str + printed, ".");
}
- if (printed < name_fixed_len) {
+ if (printed + 1 < name_fixed_len) {
printed += sprintf(str + printed, " ");
}
sprintf(str + printed, "|");