Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

File IO Speed on different locations on the same Hard Disk

Posted on 2007-11-18
11
Medium Priority
?
424 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Are You Ready for GDPR?

With the GDPR deadline set for May 25, 2018, many organizations are ill-prepared due to uncertainty about the criteria for compliance. According to a recent WatchGuard survey, a staggering 37% of respondents don't even know if their organization needs to comply with GDPR. Do you?

 
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
 
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 1500 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

Cyber Threats to Small Businesses (Part 1)

This past May, Webroot surveyed more than 600 IT decision-makers at medium-sized companies to see how these small businesses perceived new threats facing their organizations.  Read what Webroot CISO, Gary Hayslip, has to say about the survey in part 1 of this 2-part blog series.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

715 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