This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v4 2/2] add benchmark for strcoll


On 05/12/2015 07:17 PM, Siddhesh Poyarekar wrote:
On Sun, May 10, 2015 at 03:03:16PM +0200, Leonhard Holz wrote:
V4 of this patch with hopefully all nits resolved.

	* benchtests/bench-strcoll.c: New benchmark.
	* benchtests/Makefile: Generate locales and run benchmark.
	* benchtests/strcoll-inputs/filelist#C: New benchmark input file.
	* benchtests/strcoll-inputs/filelist#en_US.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#ar_SA.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#cs_CZ.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#da_DK.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#el_GR.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#en_GB.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#en_US.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#es_ES.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#fr_FR.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#hi_IN.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#hu_HU.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#is_IS.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#it_IT.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#iw_IL.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#ja_JP.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#pl_PL.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#pt_PT.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#ru_RU.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#sr_RS.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#sv_SE.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#tr_TR.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#vi_VN.UTF-8: Likewise.
	* benchtests/strcoll-inputs/lorem_ipsum#zh_CN.UTF-8: Likewise.

Thanks, I'll test and push this.

Siddhesh

Hi,

I get the following error messages while "make bench" on s390:
bench-strcoll.c: In function ‘count_words’:
bench-strcoll.c:93:3: error: implicit declaration of function ‘strdup’ [-Werror=implicit-function-declaration]
   char *tmp = strdup (text);
   ^
bench-strcoll.c:93:15: error: incompatible implicit declaration of built-in function ‘strdup’ [-Werror]
   char *tmp = strdup (text);
               ^
bench-strcoll.c:95:3: error: implicit declaration of function ‘strtok’ [-Werror=implicit-function-declaration]
   char *token = strtok (tmp, delim);
   ^
bench-strcoll.c:95:17: error: initialization makes pointer from integer without a cast [-Werror]
   char *token = strtok (tmp, delim);
                 ^
bench-strcoll.c:100:13: error: assignment makes pointer from integer without a cast [-Werror]
       token = strtok (NULL, delim);
             ^
bench-strcoll.c: In function ‘str_word_list’:
bench-strcoll.c:130:16: error: incompatible implicit declaration of built-in function ‘strdup’ [-Werror]
   char *toks = strdup (str);
                ^
bench-strcoll.c:131:16: error: initialization makes pointer from integer without a cast [-Werror]
   char *word = strtok (toks, delim);
                ^
bench-strcoll.c:136:12: error: assignment makes pointer from integer without a cast [-Werror]
       word = strtok (NULL, delim);
            ^
bench-strcoll.c: In function ‘copy_word_list’:
bench-strcoll.c:150:22: error: incompatible implicit declaration of built-in function ‘strdup’ [-Werror]
     copy->words[i] = strdup (list->words[i]);
                      ^
bench-strcoll.c: In function ‘compare_words’:
bench-strcoll.c:171:3: error: implicit declaration of function ‘strcoll’ [-Werror=implicit-function-declaration]
   return strcoll (s1, s2);
   ^
bench-strcoll.c: In function ‘main’:
bench-strcoll.c:249:7: error: implicit declaration of function ‘strchr’ [-Werror=implicit-function-declaration]
       char *locale = strchr (input_files[i], '#');
       ^
bench-strcoll.c:249:22: error: incompatible implicit declaration of built-in function ‘strchr’ [-Werror]
       char *locale = strchr (input_files[i], '#');
                      ^
bench-strcoll.c:237:12: error: variable ‘res’ set but not used [-Werror=unused-but-set-variable]
   timing_t res;
            ^
cc1: all warnings being treated as errors

The following patch fixes the issues on s390.
Please test.

Bye Stefan

---
2015-06-17  Stefan Liebler  <stli@linux.vnet.ibm.com>

	* benchtests/bench-strcoll.c:
	Include string.h.
	(main): Remove unused variable res.
diff --git a/benchtests/bench-strcoll.c b/benchtests/bench-strcoll.c
index c3d9a08..ded04a6 100644
--- a/benchtests/bench-strcoll.c
+++ b/benchtests/bench-strcoll.c
@@ -24,6 +24,7 @@
 #include <unistd.h>
 #include "json-lib.h"
 #include "bench-timing.h"
+#include <string.h>
 
 /* Many thanks to http://generator.lorem-ipsum.info/  */
 #define INPUT_PREFIX "strcoll-inputs/"
@@ -234,9 +235,6 @@ bench_file (json_ctx_t *json_ctx, const char *testname, const char *filename,
 int
 main (void)
 {
-  timing_t res;
-  TIMING_INIT (res);
-
   json_ctx_t *json_ctx = malloc (sizeof (json_ctx_t));
   assert (json_ctx != NULL);
   json_init (json_ctx, 2, stdout);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]