Google
  Web www.spinics.net

Re: Write is twice the speed as read?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Ioi Lam <Ioi.Lam@xxxxxxx> wrote:
> So I wrote two loops to time the speed of reading or writing (but not
> reading *and* writing at the same time). With a 32KB dcache, I try to
> read or write 4KB or 64KB of data using load/store multiple
> instructions. The strange results are that large blocks of writes are
> about 2x the speed of reads. The speed of memcpy is measured using the
> standard GNU C library.
>
> rd_ldmia(4)     read 4KB of data (ldmia)      134217728 bytes in     220864 us
>                                                 607.694 MByte/sec
> rd_ldmia(64)    read 64KB of data (ldmia)     134217728 bytes in    1030162 us
>                                                 130.287 MByte/sec
> wd_stmia(4)     write 4KB of data (stmia)     134217728 bytes in     544041 us
>                                                 246.705 MByte/sec
> wd_stmia(64)    write 64KB of data (stmia)    134217728 bytes in     539586 us
>                                                 248.742 MByte/sec

Are you sure there isn't anything wrong with the wd_stmia(64) loop? It
looks like it is faster than the wd_stmia(4) loop and I don't have any
explanation for this.

wd_stmia(4) being slower than rd_ldmia(4) should be OK since the cache
lines are read-allocated and subsequent loops over the same 4K memory
range should only read from the cache, while the write loop would
always write to memory if the cache line is not present.

-- 
Catalin


-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

[Site Home]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux ARM Kernel]     [Linux MIPS]     [ECOS]     [Tools]     [DDR & Rambus]     [Monitors]

Powered by Linux