After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 64982 - Unicode decomposition table could be improved
Unicode decomposition table could be improved
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Andrew Taylor
Andrew Taylor
Depends on:
Blocks:
 
 
Reported: 2001-11-20 21:28 UTC by Andrew Taylor
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed fix. (3.21 KB, patch)
2001-11-20 21:32 UTC, Andrew Taylor
none Details | Review

Description Andrew Taylor 2001-11-20 21:28:15 UTC
The table for storing Unicode decomposition data in gunidecomp.h could be
improved.  This bug is related to bug 64433, and addresses the suggested
improvements from Owen in
http://mail.gnome.org/archives/gtk-devel-list/2001-November/msg00375.html.

The table has a char pointer to a string constant in each record.  This
causes the linker to insert about 3500 unnecessary
relocations and forces the table into the .data section instead of
the .rodata section of an ELF executable.  Additionally, because char
pointers rather than const char pointers are used, all the character data
goes into .data as well.  Given that glib is shared among
many programs, getting as much data as possible in the .rodata section is
important.

Like bug 64433, the footprint can be reduced by storing indices as shorts
rather than pointers.  Furthermore, many of the decomposition expansions
are duplicated and can be folded.
Comment 1 Andrew Taylor 2001-11-20 21:32:27 UTC
Created attachment 6054 [details] [review]
Proposed fix.
Comment 2 Andrew Taylor 2001-11-20 21:40:12 UTC
Here is a patch that fixes this bug.  It puts the decomposition data
into a seperate static const decomp_expansion_string, and stores
indices into this string in the decomp_table.  In addition, table
entries that have the same expansion are not duplicated in the
decomp_expansion_string.

The return value of find_decomposition had to be changed to const, but
the behavior of all functions that depend on it is unchanged.

The footprint savings are summarized here:

       | .rodata  .data  relocs
-------+-----------------------
before | 114,727  29,508  3955
after  | 135,783   1,636   468
-------+-----------------------
         +21,056 -27,872 -3487

In other words, about 6k is saved, another 21k is moved from .data
to .rodata, and 3487 relocations are saved.  The .rodata and .data
sizes were measured with objdump -h, the relocations with objdump -R.
Comment 3 Owen Taylor 2001-11-21 01:57:36 UTC
Applied. Thanks!

Mon Nov 19 16:14:05 2001  Owen Taylor  <otaylor@redhat.com>

	* tests/Makefile.am (libmoduletestplugin_[ab]_la_LDFLAGS): 
	Add dummy -rpath argument. On some (but not all) platforms,
	libtool will only build a convenience library without this.
	(#63486, Dan Winship)