[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lynx-dev [PATCH][dev21] the binary size battle: disabling charset
From: |
Leonid Pauzner |
Subject: |
Re: lynx-dev [PATCH][dev21] the binary size battle: disabling charsets |
Date: |
Wed, 31 Mar 1999 13:22:25 +0400 (MSD) |
30-Mar-99 23:38 John Bley wrote:
> Here's an idea for allowing extra rope to hang yourself on binary size:
> disabling all the character sets except ISO-8859-1 and 7-bit ASCII
> approximations. It makes for a roughly 79KB decrease (here).
Not so effective as you think:
1) just defining ENTITIES_HTML40_ONLY will gain you another 30K decrease.
2) you are disabling charsets from UCDomap.h which have no chartrans tables,
so you gain probably a hundred of bytes but the actual code for handling
of CJK and UTF-8 is spreaded across the binary and can easily weight
for 50K decrease if would #ifndef'ed properly (but this will be
a maintainance nightmare until the code will be rewritten entirely).
3) chartrans handling code (without the tables) weight > 150K of binary
so this is an obvious loss to live with it but without the tables.
> Perhaps an extra comment should be added on the configure
> line like "(not recommended)", since this is really only meant for those
> tight on space and would be a bad choice for general users.
> The wording of the comment, the character sets to in/exclude, heck, the
> whole idea are up for comments.
> * First try at --disable-most-charsets, keeps ISO-8859-1 and 7-bit ASCII
> approximations in, leaves every other set out. (John Bley)
> --
> John Bley - address@hidden
> Duke '99 - English/Computer Science
> Since English is a mess, it maps well onto the problem space,
> which is also a mess, which we call reality. - Larry Wall
> diff -Burp lynx2-8-2/config.hin lynx2-8-2-patched/config.hin
> --- lynx2-8-2/config.hin Tue Mar 30 12:10:37 1999
> +++ lynx2-8-2-patched/config.hin Tue Mar 30 23:13:09 1999
> @@ -20,6 +20,7 @@
> #undef DISABLE_FINGER /* CF_ARG_DISABLE(finger) */
> #undef DISABLE_GOPHER /* CF_ARG_DISABLE(gopher) */
> #undef DISABLE_NEWS /* CF_ARG_DISABLE(news) */
> +#undef DISABLE_MOST_CHARSETS /* CF_ARG_DISABLE(most-charsets) */
> #undef DISP_PARTIAL /* CF_ARG_ENABLE(partial) */
> #undef DONT_TRACK_INTERNAL_LINKS /* CF_ARG_DISABLE(internal-links) */
> #undef EBCDIC /* CF_EBCDIC */
> diff -Burp lynx2-8-2/configure.in lynx2-8-2-patched/configure.in
> --- lynx2-8-2/configure.in Tue Mar 30 12:10:37 1999
> +++ lynx2-8-2-patched/configure.in Tue Mar 30 23:12:52 1999
> @@ -792,6 +792,14 @@ CF_ARG_DISABLE(ftp,
> AC_MSG_RESULT($use_ftp)
> test $use_ftp != "no" && AC_DEFINE(DISABLE_FTP)
> +AC_MSG_CHECKING(if you want to exclude most charsets)
> +CF_ARG_DISABLE(most-charsets,
> +[ --disable-most-charsets disable most charsets],
> + [use_most_charsets=yes],
> + [use_most_charsets=no])
> +AC_MSG_RESULT($use_most_charsets)
> +test $use_ftp != "no" && AC_DEFINE(DISABLE_MOST_CHARSETS)
> +
> dnl
> --------------------------------------------------------------------------
> dnl DirEd (directory-editor) options
> dnl
> --------------------------------------------------------------------------
> diff -Burp lynx2-8-2/src/UCdomap.c lynx2-8-2-patched/src/UCdomap.c
> --- lynx2-8-2/src/UCdomap.c Tue Mar 30 12:10:37 1999
> +++ lynx2-8-2-patched/src/UCdomap.c Tue Mar 30 23:00:07 1999
> @@ -32,6 +32,9 @@
> /*
> * Include chartrans tables:
> */
> +#include <iso01_uni.h> /* ISO Latin 1 */
> +#include <def7_uni.h> /* 7 bit approximations */
> +#ifndef DISABLE_MOST_CHARSETS
> #include <cp1250_uni.h> /* WinLatin2 (cp1250) */
> #include <cp1251_uni.h> /* WinCyrillic (cp1251) */
> #include <cp1252_uni.h> /* WinLatin1 (cp1252) */
> @@ -48,10 +51,8 @@
> #include <cp864_uni.h> /* DosArabic (cp864) */
> #include <cp866_uni.h> /* DosCyrillic (cp866) */
> #include <cp869_uni.h> /* DosGreek2 (cp869) */
> -#include <def7_uni.h> /* 7 bit approximations */
> #include <dmcs_uni.h> /* DEC Multinational */
> #include <hp_uni.h> /* HP Roman8 */
> -#include <iso01_uni.h> /* ISO Latin 1 */
> #include <iso02_uni.h> /* ISO Latin 2 */
> #include <iso03_uni.h> /* ISO Latin 3 */
> #include <iso04_uni.h> /* ISO Latin 4 */
> @@ -74,6 +75,7 @@
> #ifdef NOTDEFINED
> #include <mnem_suni.h>
> #endif /* NOTDEFINED */
> +#endif /* ifndef DISABLE_MOST_CHARSETS */
> /*
> * Some of the code below, and some of the comments, are left in for
> @@ -2037,6 +2039,7 @@ PUBLIC void UCInit NOARGS
> */
> UC_CHARSET_SETUP_iso_8859_1; /* ISO Latin 1 */
> +#ifndef DISABLE_MOST_CHARSETS
> UC_CHARSET_SETUP_iso_8859_15; /* ISO 8859-15 (Latin 9)*/
> UC_CHARSET_SETUP_cp850; /* DosLatin1 (cp850) */
> UC_CHARSET_SETUP_windows_1252; /* WinLatin1 (cp1252) */
> @@ -2054,7 +2057,10 @@ PUBLIC void UCInit NOARGS
> UC_CHARSET_SETUP_big5; /*** Taipei (Big5) */
> UC_CHARSET_SETUP_viscii; /* Vietnamese (VISCII) */
> +#endif /* ifndef DISABLE_MOST_CHARSETS */
> + /* This (endif, then ifdef) looks weird. Think before reacting. */
> UC_CHARSET_SETUP; /* us-ascii */ /* 7 bit approximations */
> +#ifndef DISABLE_MOST_CHARSETS
> UC_CHARSET_SETUP_x_transparent; /*** Transparent */
> @@ -2090,6 +2096,7 @@ PUBLIC void UCInit NOARGS
> #ifdef NOTDEFINED
> UC_CHARSET_SETUP_mnem;
> #endif /* NOTDEFINED */
> +#endif /* ifndef DISABLE_MOST_CHARSETS */
> /*
> * To add synonyms for any charset name
> @@ -2099,7 +2106,10 @@ PUBLIC void UCInit NOARGS
> /* easy to type: */
> LATIN1 = UCGetLYhndl_byMIME("iso-8859-1");
> US_ASCII = UCGetLYhndl_byMIME("us-ascii");
> +#ifndef DISABLE_MOST_CHARSETS
> UTF8 = UCGetLYhndl_byMIME("utf-8");
> +#endif /* ifndef DISABLE_MOST_CHARSETS */
> +
> }
> /*
> diff -Burp lynx2-8-2/src/UCdomap.h lynx2-8-2-patched/src/UCdomap.h
> --- lynx2-8-2/src/UCdomap.h Tue Mar 30 12:10:37 1999
> +++ lynx2-8-2-patched/src/UCdomap.h Tue Mar 30 23:08:11 1999
> @@ -70,6 +70,8 @@ extern void UCInit NOARGS;
> * see also UC_Charset_Setup() above for details.
> */
> +#ifndef DISABLE_MOST_CHARSETS
> +
> /*
> * There is no strict correlation for the next five, since the transfer
> * charset gets decoded into Display Char Set by the CJK code (separate
> @@ -106,5 +108,6 @@ static CONST struct unimapdesc_str dfont
> NULL,NULL,0,dfont_replacedesc_NO_fallback,\
> 128,UCT_ENC_UTF8,0)
> +#endif /* ifndef DISABLE_MOST_CHARSETS */
> #endif /* UCDOMAP_H */
- Re: lynx-dev [PATCH][dev21] the binary size battle: disabling charsets,
Leonid Pauzner <=