lnStart = seconds() lcX = replicate( "A", 15 * 1024 * 1024 ) ? seconds() - lnStartwhich runs in 0.321 seconds on my machine. And puts it in the same time frame as the API calls you are making in the second code block. Instead of concatenating 15,360 1k long strings in a loop.
>nStart = Seconds() >lnLoop = 1024*15 >lnSize = 1024 >lcString = "" >For t=0 to lnLoop-1 > lcString = lcString + Replicate("A",lnSize) >Endfor >? Seconds()-nStart >>
>Declare Long GetProcessHeap in Win32API >Declare Long HeapAlloc in Win32API Long, Long, Long >Declare memcpy in NTDLL.Dll as memcpy_write Long, String@, Long >Declare Long HeapFree in Win32API Long, Long, Long > >nStart = Seconds() >lnLoop = 1024*15 >lnSize = 1024 >lnAddress = HeapAlloc( GetProcessHeap(), 0, lnLoop*lnSize ) >For t=0 to lnLoop-1 > memcpy_write( lnAddress+(t*lnSize), Replicate("A",lnSize), lnSize ) >Endfor >? Seconds()-nStart >lcString = Sys(2600, lnAddress, lnLoop*lnSize ) >HeapFree( GetProcessHeap(), 0, lnAddress ) >? Seconds()-nStart >>