Solved

File IO Speed on different locations on the same Hard Disk

Posted on 2007-11-18
11
417 Views
Last Modified: 2013-12-04
I am using C# (VS2005) on an XP machine. I noticed a rather baffling thing, I am storing a lot of data on my application close event. I use the Current User -> Local Settings path to store the data (typically C:\Documents and Settings\Arif\Local Settings\Application Data). It takes around 50 Seconds to store the entire data. By chance I happened to change the storage path to Bin folder of my Application, now it took only 10 seconds to store the same data. Could not understand why, has anyone noticed this before? Is there any logical reason why this would happen.
Could it be that it requires the piece of code to security validations before accessing the Local Settings folder while Bin is immediately accessibl.  How can I improve the performance here in case I want to store it in the Local Settings folder only?

Thanks
0
Comment
Question by:arif_eqbal
  • 6
  • 3
  • 2
11 Comments
 
LVL 25

Expert Comment

by:imitchie
ID: 20310469
it is possible that your disk writes have just moved to an area on your disk that is on the far outer ring. defragging your hd regularly should make the times more consistent no matter where you place it. the NTFS system is agnostic to where you put it, a file in C:\Documents and Settings.... could be right next to one in C:\Program Files.... or some fragments may be together and others as far away as you can imagine.  if anything, local settings would be far more relaxed in security than program files
0
 
LVL 25

Expert Comment

by:imitchie
ID: 20310511
i guess the unasked question was, if you now switch it back to Local Settings, does it go back to 50s? if not, then it's got nothing to do with location
0
 
LVL 19

Author Comment

by:arif_eqbal
ID: 20310687
Well imitchie,
it does take 50s again if I switch back to the old location, this is pretty consistent, Bin takes less time and Local Storage more.
Also, to confirm your earlier comment I tried the same on a different machine (AMD 64 Bit, with XP) and again the same mismatch.
Just wanted to mention here I am using the IsolatedStorage, however, I feel the basic question remains unchaged, because all isolatedStorage does is give me a stream with a file on the path of Local Settings, and I have tested it that getting the stream does not take any time at all, its after that while writing that it takes 50 seconds. I feel there's a scope of improvement here since, if instead of opening the file in the IsolatedStorage location I open it on Bin folder I get 5 times better performance.
0
 
LVL 25

Expert Comment

by:imitchie
ID: 20310712
are you able to do other timings, time taken from start of streaming to end of streaming - raw disk access after all security checks? i've never heard of it taking 40s to check access. given these are both your machines, would you have configured them exactly the same way? is the setup 1 disk per machine, or do you have raid 0/1?
0
 
LVL 25

Expert Comment

by:imitchie
ID: 20310718
another thing to check is, have you configured the path to the app\bin folder as an exception in antivirus software?
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 25

Expert Comment

by:imitchie
ID: 20310722
are you on a domain with roaming set up? it could be mirroring the profile to make it inheritable from other machines.
0
 
LVL 25

Expert Comment

by:imitchie
ID: 20310725
try scrolling to the 3rd and 2nd last comments on this page:
http://episteme.arstechnica.com/eve/forums/a/tpc/f/99609816/m/801002212831
30 second wait sound similar to your 40s lag
0
 
LVL 8

Accepted Solution

by:
doraiswamy earned 500 total points
ID: 20310731
a) Try some folders other than bin or Documents and Settings and see what impact there is on performance.

b) Copy your project exe file to the docs and settings folder and see if running it from there makes a difference.

c) It may be possible that if both your exe and data files are in the same physical area of disk, there may be fewer seeks for the drive to make - this is true if your application is large enough that all of it is not loaded into memory at the same time, and page faults are generated.
0
 
LVL 19

Author Comment

by:arif_eqbal
ID: 20310866
doraiswamy - I have tried different machines now, and different locations on the same machine/disk. In fact I checked the exact location used by IsolatedStorage and hardcoded that path its 5 times faster if I use any path compared to IsolatedStorage.

imitchie - went through the IsolatedStorage concepts on MSDN in some detail it might be slightly slower but not as drastically as I am experiencing. No I am not on a roaming set up, and I have tested it on 3 normal single disk machines so far. Don't intend to test on a Raid because that's not going to be the case at client anyway.
Just went through the link you sent, would read it minutely again, though different problem but yes it might be due to the same reason.
I can just dump this idea of IsloatedStorage altogether but not before giving it a good try. Could not digest the fact that it can degrade performance to this extent by using such a simple thing. IsolatedStorage does not do anything more than give me access to a secured and rather unknown location on the disk, must be something somewhere which would be pulling it down.

Thanks
0
 
LVL 19

Author Comment

by:arif_eqbal
ID: 20372670
Didn't get a very convincing reason for the time lag on the Net, in fact there are only very basic information about the isolated Storage on the Net. Looks like a less explored feature.
Also, I ran into some issues when I strong Named my application, some version colnflicts. It seems the List<T> does not go very well with the isolated storage when the version (just minor version) has changed for your app.
Putting it here just for information.
Thanks
0
 
LVL 8

Expert Comment

by:doraiswamy
ID: 20372866
Arif, thanks.
0

Featured Post

Free camera licenses with purchase of My Cloud NAS

Milestone Arcus software is compatible with thousands of industry-leading cameras for added flexibility. Upon installation on your My Cloud NAS, you will receive two (2) camera licenses already enabled in the software. And for a limited time, get additional camera licenses FREE.

Join & Write a Comment

In a recent article here at Experts Exchange (http://www.experts-exchange.com/articles/18880/PaperPort-14-in-Windows-10-A-First-Look.html), I discussed my nine-month sandbox testing of the Windows 10 Technical Preview, specifically with respect to r…
Recently, I read that Microsoft has analysed statistics for their security intelligence report. It revealed: still, the clear majority of windows users do their daily work as administrator. An administrative account is a burden, security-wise. My ar…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now