none
File Copy Performance in Windows CE 6.0 Cmd RRS feed

  • Question

  • We have a product using Windows CE 6.0 running on a Freescale i.MX28 Processor. We have noticed that performing a file copy from a memory stick to local NAND flash takes significantly longer from a bat file (cmd copy) than using the file explorer or an application API copy.

    We created a test app to time the difference for transferring different file sizes between a cmd window copy and API copy. For example a 1MB file takes 1.831 seconds to copy using API calls or 22.062 seconds using a cmd window. Copying our 13MB app using a batch file takes several minutes vs 10 seconds or so for a copy using the explorer shell.

    I have tried looking at different debug outputs to see what happens during the copy that could be different. With the diskcache.dll debug output enabled I see a huge amount of debug when using the cmd window compared to the API copy.

    If I turn on the debug messages from Filesys.dll I get a load of DB messages during the cmd window file copy that are not present for the API copy. It seems the cmd window does something with a db (the object store?). For example:

    21636976 PID:400002 TID:d10002 DB:SeekDB: Seeked to oid 0x34000009 (0)

    21636976 PID:400002 TID:d10002 DB:ReadRec(0x0009):cProps 3, Buf 0x00000000, BufSize 0, SizeNeeded 48

    21636976 PID:400002 TID:d10002 DB:ReadRec:Decompressed block 0x0009. Len 136(70)

    21636976 PID:400002 TID:d10002 DB:ReadRec:Found prop 0x0001001f. SizeNeeded 136

    21636976 PID:400002 TID:d10002 DB:ReadRec:Found prop 0x0002001f. SizeNeeded 180

    21636976 PID:400002 TID:d10002 DB:ReadRec:Found prop 0x00030013. SizeNeeded 180

    21636976 PID:400002 TID:d10002 DB:ReadRec:Insufficient buffer;Buf 0x00000000(0). Needed 180. ReallocFlag 0

    21636976 PID:400002 TID:d10002 DB:ReadRec(0x0009):cProps 3, Buf 0x04025aa0, BufSize 180, SizeNeeded 48

    21636976 PID:400002 TID:d10002 DB:ReadRec:Decompressed block 0x0009. Len 136(70)

    21636976 PID:400002 TID:d10002 DB:ReadRec:Found prop 0x0001001f. SizeNeeded 136

    21636976 PID:400002 TID:d10002 DB:ReadRec:Found prop 0x0002001f. SizeNeeded 180

    21636976 PID:400002 TID:d10002 DB:ReadRec:Found prop 0x00030013. SizeNeeded 180

    21636976 PID:400002 TID:d10002 DB:CeReadRecordProps read record 34000009

    Can anyone help shed any light as to why copying using the cmd window is so much slower?

    Thursday, August 7, 2014 3:40 PM

All replies

  • Just a guess, the command line copy doesn't use the API.  Why does it matter though?   If this is important to you, then write a small app to copy the file using the API.

    Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http://geekswithblogs.net/bruceeitman Eurotech Inc. www.Eurotech.com

    Thursday, August 7, 2014 4:36 PM
    Moderator
  • Hi Bruce,

    Thanks for your reply - also thanks publishing so much useful information on Windows CE! Your website (and many forum responses) have been very useful in helping us develop our product.

    I appreciate we could easily write our own simple file-copy utility. This issue was only shown during installation of our application from a USB stick where we had an 'app install' bat file that copied a CAB file to the NAND and then executed wceload to extract and 'install' it.

    We noticed the copy took an excessive amount of time and initially thought it was USB transfer issues. Further investigation led to identifying cmd as being so much slower than other copy mechanisms.

    I guess to round off the issue (and to understand what mechanisms can cause slow file access) we just wanted to understand why cmd was slower. From my basic understanding I would have expected cmd to use the same copy process as explorer.

    Using Windows CE has been a steep learning process and we didn't notice this behaviour with our previous hardware platform. I was wondering if this issue had its roots in settings for file cacheing but the file system registry options are the same for both platforms. I prefer to try and understand why something is acting the way it is before resorting to work-arounds.

    Kind regards, Mark

    Friday, August 8, 2014 10:46 AM
  • Verify File Cache Manager(SYSGEN_CACHEFILT) Catalog Item is enabled. If so, Please disable and test.

    Tuesday, August 12, 2014 3:59 AM