Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

u8_textprep.o is much too big #984

Closed
nyh opened this issue Jun 28, 2018 · 0 comments
Closed

u8_textprep.o is much too big #984

nyh opened this issue Jun 28, 2018 · 0 comments

Comments

@nyh
Copy link
Contributor

nyh commented Jun 28, 2018

Here are the object files with the biggest text (code) size:

$ find build/last/ -name "*.o" -exec size \{\} \;| sort -nr | head  
   text	   data	    bss	    dec	    hex	filename
 314469          0          0     314469      4cc65    build/last/bsd/sys/cddl/contrib/opensolaris/common/unicode/u8_textprep.o
 150483       1144        665     152292      252e4    build/last/core/trace.o
 134476       4104        361     138941      21ebd    build/last/tests/tst-rename.o
 126209       3820      14705     144734      2355e    build/last/fs/vfs/main.o
 125812         12        857     126681      1eed9    build/last/loader.o
 117515        256        721     118492      1cedc    build/last/core/elf.o
 102281        292        721     103294      1937e    build/last/core/mmu.o
  99201       8488        259     107948      1a5ac    build/last/tools/cpiod/cpiod.o
  94493       5824        214     100531      188b3    build/last/tests/misc-tcp.o
  90602          8         18      90628      16204    build/last/core/commands.o

The biggest offender is u8_textprep.o. This includes u8_textprep_data.h, a 1.5 MB (!) source file full of huge arrays (I'm not sure, by the way, why all this data is listed as "text" and not "data"!). Could we do something to not have this monster in OSv?

I'm not sure there's an easy solution, but it would be good to investigate.

wkozaczuk pushed a commit to wkozaczuk/osv that referenced this issue Jul 21, 2018

Verified

This commit was signed with the committer’s verified signature.
snyk-bot Snyk bot
ZFS has a "utf8 normalization" option which needs to be enabled during
filesystem creation (I believe it is off by default). The ugly part is
that the code which implements this uses huge tables -
build/last/bsd/sys/cddl/contrib/opensolaris/common/unicode/u8_textprep.o
is over 300 KB and grows OSv's disk image size and memory use.

In this patch, we comment out this obscure feature. u8_textprep.o becomes
tiny, and the compressed kernel is now about 130 KB smaller (the saving
in memory, uncompressed, is even larger).

Fixes cloudius-systems#984

Signed-off-by: Nadav Har'El <n...@scylladb.com>
Message-Id: <20180704155237.28607-1-nyh@scylladb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant