Page 1 of 1

I know MEMCPY

Posted: Sun Feb 20, 2005 4:42 am
by LOst
I know that memcpy, memset, and the related functions in Windows are optimized to copy 16 bytes at a time.
Is ReactOS optimized this way, or is it slow as hell (copying/setting 1 byte at a time in the data loop)?

So many things are dependent on copying data as fast as possible.

Posted: Sun Feb 20, 2005 11:11 am
by GvG
Our implementation of e.g. memset is in reactos/lib/string/i386/memset.s. We set 4 bytes at a time, DWORD-aligned.

Posted: Sun Feb 20, 2005 9:18 pm
by LOst
GvG wrote:Our implementation of e.g. memset is in reactos/lib/string/i386/memset.s. We set 4 bytes at a time, DWORD-aligned.
Cool.
So if I change this into 16 bytes (using floating point asm), will it work?

Posted: Sun Feb 20, 2005 9:36 pm
by GvG
Depends on whether you introduce bugs I guess :) I'd be interested if you see a measurable performance improvement.

Posted: Sun Feb 20, 2005 9:47 pm
by LOst
GvG wrote:Depends on whether you introduce bugs I guess :) I'd be interested if you see a measurable performance improvement.
This will be one of the first things I will test, as soon as I can compile ReactOS. I still haven't downloded GCC and all the stuff needed. I'm very interested in working with ReactOS in the future

Posted: Sun Feb 20, 2005 10:28 pm
by blight
...

Posted: Mon Feb 21, 2005 5:00 am
by LOst
blight wrote:I doubt that this will improve overall speed - you would have to save and restore the MMX/SSE state before and after using such opcodes (KeSaveFloatingPointState/KeRestoreFloatingPointState - check MSDN: Using Floating Point or MMX in a WDM Driver for more information)
Okay, so these calls may slow down things. Well, it was worth asking at least.