mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Harald Becker <ralda@gmx.de>
Cc: musl@lists.openwall.com, dalias@aerifal.cx
Subject: Re: ARM memcpy post-0.9.12-release thread
Date: Wed, 31 Jul 2013 05:13:47 +0200	[thread overview]
Message-ID: <20130731051347.7d8340ac@ralda.gmx.de> (raw)
In-Reply-To: <20130731022631.GA6655@brightrain.aerifal.cx>

Hi Rich !

30-07-2013 22:26 Rich Felker <dalias@aerifal.cx>:

> Some rough times (128k copy repeated 10000 times):
> 
> Aligned case:
> Current C code: 1.2s
> My best-attempt C code: 0.75s
> My best-attempt inline asm: 0.57s
> Bionic asm: 0.63s
> Bionic asm without prefetch: 0.57s
> 
> Misaligned case:
> Current C code: 4.7s
> My best-attempt inline asm: 2.9s
> Bionic asm: 1.1s

I like to throw in a question, as my cent to this topic:

Does modern C Compiler not try to align all data types? So
following this path in most cases aligned data structures are
used and copying them around usually hit the aligned case. The
misaligned case happens mostly due to working with strings, and
those are usually short. Can't we consider other misaligned cases
violation of the programmer or code generator? If so, I would
prefer the best-attempt inline asm versions of code or even
best attempt C code over arch specific asm versions ... and add
a warning for performance lose on misaligned data in
documentation, with giving a rough percentage of this lose.

Those who really need to work with misaligned data may follow
the link and consider to add an optimized memcpy to there work.

May be, musl archive or web sit may hold a contribution directory
with such optimized replacement functions, (nearly) ready for
inclusion in other projects, but as officially unmaintained code.

--
Harald


  reply	other threads:[~2013-07-31  3:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-31  2:26 Rich Felker
2013-07-31  3:13 ` Harald Becker [this message]
2013-07-31  3:23   ` Rich Felker
2013-07-31  4:18     ` Harald Becker
2013-07-31  6:13       ` Rich Felker
2013-08-02 20:41 ` Rich Felker
2013-08-02 22:03   ` Andre Renaud
2013-08-03  0:01     ` Rich Felker
2013-08-05 21:24     ` Rich Felker

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=20130731051347.7d8340ac@ralda.gmx.de \
    --to=ralda@gmx.de \
    --cc=dalias@aerifal.cx \
    --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).