On 13/11/16 14:14, Pádraig Brady wrote:
> On 13/11/16 12:42, Torbjörn Granlund wrote:
>> Pádraig Brady <[email protected]> writes:
>>
>>   I was just looking at the overhead of proper_name_utf8() vs proper_name()
>>   in coreutils, and noticed that using the former adds about 18K to each 
>> program.
>>   For example truncate(1) is 62K with and 44K without.
>>   I'm going to simplify usages for my name at least.
>>   I don't care and anyway no one can pronounce it no matter which form is 
>> used :)
>>   I was wondering if you preferred to keep utf8 usage for your names?
>>   These names are seen in `cat --version` output etc.
>>   
>> I don't care about Torbjörn vs Torbjorn.  (Actually, I think it's not
>> necessary to plug authors' names at all from the binaries.)
> 
> Cool thanks.
> I'll push the attached later,
> which reduces a standard coreutils install by about 160KB.

V2 attached also updates sc_check-AUTHORS
as otherwise it would now have been skipped all the time.

>From ab65539d59714fd65949a8e4bdc941f59825b3c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]>
Date: Sun, 13 Nov 2016 14:08:48 +0000
Subject: [PATCH] all: reduce usage of proper_name_utf8()

This reduces a standard coreutils install size by about 160K.

* src/cat.c: Change to proper_name() which removes about 18K text.
* src/cp.c: Likewise.
* src/df.c: Likewise.
* src/du.c: Likewise.
* src/getlimits.c: Likewise.
* src/realpath.c: Likewise.
* src/split.c: Likewise.
* src/stdbuf.c: Likewise.
* src/timeout.c: Likewise.
* src/truncate.c: Likewise.
* src/local.mk: Remove -llibiconv from the above programs.
* cfg.mk (sc_check-AUTHORS): Adjust to use factor(1).
* AUTHORS: Adjust to use ASCII where to satisfy sc_check-AUTHORS.
---
 AUTHORS         | 18 +++++++++---------
 cfg.mk          |  2 +-
 src/cat.c       |  2 +-
 src/cp.c        |  2 +-
 src/df.c        |  2 +-
 src/du.c        |  2 +-
 src/getlimits.c |  2 +-
 src/local.mk    | 10 ----------
 src/realpath.c  |  2 +-
 src/split.c     |  2 +-
 src/stdbuf.c    |  2 +-
 src/timeout.c   |  2 +-
 src/truncate.c  |  2 +-
 13 files changed, 20 insertions(+), 30 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 572ad59..8606f1e 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -5,7 +5,7 @@ arch: David MacKenzie, Karel Zak
 base32: Simon Josefsson
 base64: Simon Josefsson
 basename: David MacKenzie
-cat: Torbjörn Granlund, Richard M. Stallman
+cat: Torbjorn Granlund, Richard M. Stallman
 chcon: Russell Coker, Jim Meyering
 chgrp: David MacKenzie, Jim Meyering
 chmod: David MacKenzie, Jim Meyering
@@ -14,16 +14,16 @@ chroot: Roland McGrath
 cksum: Q. Frank Xia
 comm: Richard M. Stallman, David MacKenzie
 coreutils: Alex Deymo
-cp: Torbjörn Granlund, David MacKenzie, Jim Meyering
+cp: Torbjorn Granlund, David MacKenzie, Jim Meyering
 csplit: Stuart Kemp, David MacKenzie
 cut: David M. Ihnat, David MacKenzie, Jim Meyering
 date: David MacKenzie
 dd: Paul Rubin, David MacKenzie, Stuart Kemp
-df: Torbjörn Granlund, David MacKenzie, Paul Eggert
+df: Torbjorn Granlund, David MacKenzie, Paul Eggert
 dir: Richard M. Stallman, David MacKenzie
 dircolors: H. Peter Anvin
 dirname: David MacKenzie, Jim Meyering
-du: Torbjörn Granlund, David MacKenzie, Paul Eggert, Jim Meyering
+du: Torbjorn Granlund, David MacKenzie, Paul Eggert, Jim Meyering
 echo: Brian Fox, Chet Ramey
 env: Richard Mlynarik, David MacKenzie
 expand: David MacKenzie
@@ -65,7 +65,7 @@ printf: David MacKenzie
 ptx: François Pinard
 pwd: Jim Meyering
 readlink: Dmitry V. Levin
-realpath: Pádraig Brady
+realpath: Padraig Brady
 rm: Paul Rubin, David MacKenzie, Richard M. Stallman, Jim Meyering
 rmdir: David MacKenzie
 runcon: Russell Coker
@@ -79,9 +79,9 @@ shred: Colin Plumb
 shuf: Paul Eggert
 sleep: Jim Meyering, Paul Eggert
 sort: Mike Haertel, Paul Eggert
-split: Torbjörn Granlund, Richard M. Stallman
+split: Torbjorn Granlund, Richard M. Stallman
 stat: Michael Meskes
-stdbuf: Pádraig Brady
+stdbuf: Padraig Brady
 stty: David MacKenzie
 sum: Kayvan Aghaiepour, David MacKenzie
 sync: Jim Meyering, Giuseppe Scrivano
@@ -89,11 +89,11 @@ tac: Jay Lepreau, David MacKenzie
 tail: Paul Rubin, David MacKenzie, Ian Lance Taylor, Jim Meyering
 tee: Mike Parker, Richard M. Stallman, David MacKenzie
 test: Kevin Braunsdorf, Matthew Bradburn
-timeout: Pádraig Brady
+timeout: Padraig Brady
 touch: Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, Randy Smith
 tr: Jim Meyering
 true: Jim Meyering
-truncate: Pádraig Brady
+truncate: Padraig Brady
 tsort: Mark Kettenis
 tty: David MacKenzie
 uname: David MacKenzie
diff --git a/cfg.mk b/cfg.mk
index 11e42b9..39d4f87 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -261,7 +261,7 @@ au_dotdot = authors-dotdot
 au_actual = authors-actual
 sc_check-AUTHORS: $(all_programs)
 	@locale=en_US.UTF-8;				\
-	LC_ALL=$$locale ./src/cat --version		\
+	LC_ALL=$$locale ./src/factor --version		\
 	    | grep ' Torbjorn '	> /dev/null		\
 	  && { echo "$@: skipping this check"; exit 0; }; \
 	rm -f $(au_actual) $(au_dotdot);		\
diff --git a/src/cat.c b/src/cat.c
index 411ffec..f337c34 100644
--- a/src/cat.c
+++ b/src/cat.c
@@ -45,7 +45,7 @@
 #define PROGRAM_NAME "cat"
 
 #define AUTHORS \
-  proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund"), \
+  proper_name ("Torbjorn Granlund"), \
   proper_name ("Richard M. Stallman")
 
 /* Name of input file.  May be "-".  */
diff --git a/src/cp.c b/src/cp.c
index 97a868a..926e05b 100644
--- a/src/cp.c
+++ b/src/cp.c
@@ -54,7 +54,7 @@
 #define PROGRAM_NAME "cp"
 
 #define AUTHORS \
-  proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund"), \
+  proper_name ("Torbjorn Granlund"), \
   proper_name ("David MacKenzie"), \
   proper_name ("Jim Meyering")
 
diff --git a/src/df.c b/src/df.c
index 470d5ee..8f760db 100644
--- a/src/df.c
+++ b/src/df.c
@@ -41,7 +41,7 @@
 #define PROGRAM_NAME "df"
 
 #define AUTHORS \
-  proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund"), \
+  proper_name ("Torbjorn Granlund"), \
   proper_name ("David MacKenzie"), \
   proper_name ("Paul Eggert")
 
diff --git a/src/du.c b/src/du.c
index ab61909..cef8dac 100644
--- a/src/du.c
+++ b/src/du.c
@@ -50,7 +50,7 @@ extern bool fts_debug;
 #define PROGRAM_NAME "du"
 
 #define AUTHORS \
-  proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund"), \
+  proper_name ("Torbjorn Granlund"), \
   proper_name ("David MacKenzie"), \
   proper_name ("Paul Eggert"), \
   proper_name ("Jim Meyering")
diff --git a/src/getlimits.c b/src/getlimits.c
index e49a658..b2f5670 100644
--- a/src/getlimits.c
+++ b/src/getlimits.c
@@ -27,7 +27,7 @@
 
 #define PROGRAM_NAME "getlimits"
 
-#define AUTHORS proper_name_utf8 ("Padraig Brady", "P\303\241draig Brady")
+#define AUTHORS proper_name ("Padraig Brady")
 
 #ifndef TIME_T_MAX
 # define TIME_T_MAX TYPE_MAXIMUM (time_t)
diff --git a/src/local.mk b/src/local.mk
index a8d7866..9e36ad9 100644
--- a/src/local.mk
+++ b/src/local.mk
@@ -288,19 +288,9 @@ src_ls_LDADD += $(LIB_HAS_ACL)
 copy_ldadd += $(LIB_XATTR)
 
 # for print_unicode_char, proper_name_utf8
-src_cat_LDADD += $(LIBICONV)
-src_cp_LDADD += $(LIBICONV)
-src_df_LDADD += $(LIBICONV)
-src_du_LDADD += $(LIBICONV)
 src_factor_LDADD += $(LIBICONV)
-src_getlimits_LDADD += $(LIBICONV)
 src_printf_LDADD += $(LIBICONV)
 src_ptx_LDADD += $(LIBICONV)
-src_realpath_LDADD += $(LIBICONV)
-src_split_LDADD += $(LIBICONV)
-src_stdbuf_LDADD += $(LIBICONV)
-src_timeout_LDADD += $(LIBICONV)
-src_truncate_LDADD += $(LIBICONV)
 
 # for libcrypto hash routines
 src_md5sum_LDADD += $(LIB_CRYPTO)
diff --git a/src/realpath.c b/src/realpath.c
index fb9beb7..ce2f2b3 100644
--- a/src/realpath.c
+++ b/src/realpath.c
@@ -30,7 +30,7 @@
 /* The official name of this program (e.g., no 'g' prefix).  */
 #define PROGRAM_NAME "realpath"
 
-#define AUTHORS proper_name_utf8 ("Padraig Brady", "P\303\241draig Brady")
+#define AUTHORS proper_name ("Padraig Brady")
 
 enum
 {
diff --git a/src/split.c b/src/split.c
index 2b7a626..f9c99db 100644
--- a/src/split.c
+++ b/src/split.c
@@ -46,7 +46,7 @@
 #define PROGRAM_NAME "split"
 
 #define AUTHORS \
-  proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund"), \
+  proper_name ("Torbjorn Granlund"), \
   proper_name ("Richard M. Stallman")
 
 /* Shell command to filter through, instead of creating files.  */
diff --git a/src/stdbuf.c b/src/stdbuf.c
index 74553c6..f583c6a 100644
--- a/src/stdbuf.c
+++ b/src/stdbuf.c
@@ -35,7 +35,7 @@
 #define PROGRAM_NAME "stdbuf"
 #define LIB_NAME "libstdbuf.so" /* FIXME: don't hardcode  */
 
-#define AUTHORS proper_name_utf8 ("Padraig Brady", "P\303\241draig Brady")
+#define AUTHORS proper_name ("Padraig Brady")
 
 static char *program_path;
 
diff --git a/src/timeout.c b/src/timeout.c
index 462ef6b..10a3e09 100644
--- a/src/timeout.c
+++ b/src/timeout.c
@@ -75,7 +75,7 @@
 
 #define PROGRAM_NAME "timeout"
 
-#define AUTHORS proper_name_utf8 ("Padraig Brady", "P\303\241draig Brady")
+#define AUTHORS proper_name ("Padraig Brady")
 
 static int timed_out;
 static int term_signal = SIGTERM;  /* same default as kill command.  */
diff --git a/src/truncate.c b/src/truncate.c
index ccc0e90..5f688ff 100644
--- a/src/truncate.c
+++ b/src/truncate.c
@@ -35,7 +35,7 @@
 /* The official name of this program (e.g., no 'g' prefix).  */
 #define PROGRAM_NAME "truncate"
 
-#define AUTHORS proper_name_utf8 ("Padraig Brady", "P\303\241draig Brady")
+#define AUTHORS proper_name ("Padraig Brady")
 
 /* (-c) If true, don't create if not already there */
 static bool no_create;
-- 
2.5.5

Reply via email to