All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matthias Weißer" <weisserm@arcor.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arm: Use optimized memcpy and memset from linux
Date: Mon, 24 Jan 2011 20:24:28 +0100	[thread overview]
Message-ID: <4D3DD1EC.7010506@arcor.de> (raw)
In-Reply-To: <20110124161338.B0345D42A89@gemini.denx.de>

Am 24.01.2011 17:13, schrieb Wolfgang Denk:
> Dear Matthias Weisser,
> 
> In message <1295884607-9044-1-git-send-email-weisserm@arcor.de> you wrote:
>> Using optimized versions of memset and memcpy from linux brings a quite
>> noticeable speed (x2 or better) improvement for these two functions.
>>
>> Size impact:
>>
>> C version:
>>    text    data     bss     dec     hex filename
>>  202862   18912  266456  488230   77326 u-boot
>>
>> ASM version:
>>    text    data     bss     dec     hex filename
>>  203798   18912  266288  488998   77626 u-boot
> 
> How exactly did you measure the speed improvement?

I inserted a printf before and after calls to these functions with sizes
of 1MB or more each. I then measured the times between these printfs
using grabserial (http://elinux.org/Grabserial). In both cases caches
where enabled.

To be precise: As memset test case I used the memset(.., 0, ..) of the
malloc pool (which was 4MB in my case) and a memcpy from flash to RAM
which I inserted in cmd_bootm.c of about 2.2MB (see RFC patch
http://patchwork.ozlabs.org/patch/79480/ for exact location of the memcpy).

Do you think a factor of 2 is not possible against the C version? Maybe
I have done something wrong while measuring theses times. From my point
of view it should be possible to get such improvements as the code takes
cache alignment into account and also uses the PLD instruction.

I can do some additional measurements tomorrow on two systems (jadecpu
with a 32Bit at 166MHz DDR2 memory and a imx25 based on with 16Bit at 133MHz
LPDDR) and come up with some exact numbers. Maybe you can give some more
hints what and how the improvements of this patch can be measured.

Matthias Wei?er

  reply	other threads:[~2011-01-24 19:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-24 15:56 [U-Boot] [PATCH] arm: Use optimized memcpy and memset from linux Matthias Weisser
2011-01-24 16:13 ` Wolfgang Denk
2011-01-24 19:24   ` Matthias Weißer [this message]
2011-01-24 20:07     ` Wolfgang Denk
2011-01-25 10:55       ` Matthias Weißer
2011-01-25 20:05         ` Wolfgang Denk
2011-01-26 10:45 ` [U-Boot] [PATCH V2] " Matthias Weisser
2011-01-26 12:07   ` Albert ARIBAUD
2011-01-26 12:50     ` Matthias Weißer
2011-01-26 13:07       ` Wolfgang Denk
2011-01-27 18:39         ` Albert ARIBAUD
2011-02-20 19:35   ` Alexander Holler
2011-03-03  7:07   ` Albert ARIBAUD
2011-03-11  7:36 ` [U-Boot] [PATCH V3] " Matthias Weisser
2011-03-24 14:34   ` Albert ARIBAUD

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=4D3DD1EC.7010506@arcor.de \
    --to=weisserm@arcor.de \
    --cc=u-boot@lists.denx.de \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.