Main Site Documentation

File System Write Speed


#1

Hi All,
I’ve just started to integration test the code I’ve written for Chipworkx

I’m seeing file writes taking quite some time:


PersistentStorage sdPS = new PersistentStorage("SD");

            // Mount the file system
            sdPS.MountFileSystem();

           byte[] message = new byte[102400];
            for (int i = 0; i < message.Length; i++)
            {
                message[i] = (byte)i;
            }

            Debug.Print("Writing Large File: " + System.DateTime.Now.ToString("T"));
            WriteFile(@ "\SD\testFile.txt", message);

            Debug.Print("Finished writing Large File: " + System.DateTime.Now.ToString("T"));

Console outputs the following in debug mode:
[italic]Writing Large File: 00:04:34
Writing File: \SD\testFile.txt
Finished writing Large File: 00:04:55
[/italic]
Hence it takes 21 seconds to write 100 kb = approx 4.76 kb per second
I would have expected at least 2mb /s
Is this common in the .net micro framework? Is there anything I can do to speed this up?
Thanks all :),
Ronan


#2

Please see this:
http://www.tinyclr.com/forum/1/1858/