From: idunham@lavabit.com
To: musl@lists.openwall.com
Subject: Re: ether_* functions
Date: Sat, 8 Jun 2013 08:24:00 -0700 [thread overview]
Message-ID: <20130608152400.GA30028@Caracal> (raw)
In-Reply-To: <20130607162326.GA30843@brightrain.aerifal.cx>
On Fri, Jun 07, 2013 at 12:23:26PM -0400, Rich Felker wrote:
> Hi all,
>
> The previous conversation about ether_aton/ntoa trailed off without
> really reaching a conclusion. I'd like to get these interfaces
> integrated for the next release. Does anyone have opinions on which
> version we should use: the think sscanf/snprintf wrappers (which I
> proposed), or the versions (by Strake) with all the logic inline that
> don't depend on other heavy functions?
I was about to say the thin wrappers because I want to avoid bloat
in libc.so and in programs that use both ether_* and *printf/sscanf,
but how much is the difference in ether_aton_r object size?
OK, let's test (Strake's last version vs Rich's scanf version,
gcc 4.4 on Debian, musl from within the last couple weeks):
/tmp$ /opt/musl/bin/musl-gcc -std=c99 -D_XOPEN_SOURCE=700 -c
ether_aton.c
/tmp$ /opt/musl/bin/musl-gcc -std=c99 -D_XOPEN_SOURCE=700 -c
ether_aton_scanf.c
/tmp$ size *.o
text data bss dec hex filename
161 0 6 167 a7 ether_aton.o
182 0 0 182 b6 ether_aton_scanf.o
With -O3:
328 0 0 328 148 ether_aton.o
142 0 0 142 8e ether_aton_scanf.o
With -Os:
101 0 0 101 65 ether_aton.o
113 0 0 113 71 ether_aton_scanf.o
Huh? I'm wondering why scanf would be _larger_ with no -O and with
-Os.
ether_ntoa is using sprintf already.
So I'll vote for Strake's version.
HTH,
Isaac Dunham
prev parent reply other threads:[~2013-06-08 15:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-07 16:23 Rich Felker
2013-06-08 15:24 ` idunham [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130608152400.GA30028@Caracal \
--to=idunham@lavabit.com \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).