Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

You've most certainly read it on the internet, and you may have even heard other supposedly computer-savvy people suggest that deleting temporary files speeds up your (Windows) computer.

But how does that actually work? Drawing on my limited theoretical knowledge of file systems and disk drives, I cannot understand how deleting temporary files should improve file system performance unless the disk is nearly full. How can a temporary file that just sits there impair performance? Can somebody offer a technical explanation of why deleting temporary files (and cookies, and prefetch files) should or shouldn't have an effect on performance?

Edit: It appears that Microsoft thinks so.

share|improve this question
4  
Since I haven't "read it on the internet", please provide some links. –  sawdust Oct 24 '11 at 5:53
    
A quick search yielded these results. Plenty of people seem to think that deleting temporary files speeds up your computer. Even a Microsoft page suggests so! But I have a hard time understanding exactly how a file that just sits there doing nothing can impair performance (unless in the case of very limited storage space). –  Terribad Oct 24 '11 at 7:44
1  
@Terribad: you might want to include the links directly in your question, to prevent further upvotes of the above "please provide some links" comment –  Rabarberski Oct 24 '11 at 7:59
    
@Rabarberski: Ha ha, point taken. I assume that most Windows "super users" have tried to perform some sort of optimization on their computer, and in attempting to do so have used Internet search engines for relevant information, and in doing so have encountered common Windows maintenance advice such as "delete your temporary files". :) I chose not to provide links in my original question because there are so many relevant websites for the world's most popular operating system, but I suppose I should include the Microsoft link since it is presumably more authoritative. –  Terribad Oct 24 '11 at 10:49

3 Answers 3

I can certainly vouch for the speedup associated with having a huge number of files in your temp folder. I've had my current laptop for 2-3 yrs and never deleted temp files... then one day I installed AVG PC-Tuneup and inadvertently deleted my temp files (the UI sucks). Wham! Actual, percievable speedup.

I can think of a few reasons for why:

1) NTFS has to make 8.3 filesnames for every file (unless you tweak it via fsutil). Its gets progressively harder once your folder has a large number of files. Also applications that make the temp files, have to search for a unique name. I had a pokey old 4200 rpm drive, so each seek was very expensive, and lots of seeks were needed because (see point2)

2) Size of the MFT. The Master File Table can become many hundreds of MB in size and won't be cached as often (or atleast more of it will pbe paged out all the time). ntfsinfo from Sys Interals will give you the deets...

3) Each time the temp folder is enumerated - there's a lot more work to be done - esp. if you have a virus scanner that checks all the files in a folder, each time the folder is enumerated! I'd also been very aggresive with Windows Search indexing. Excluding the temp folder from the index, helped speed-up my computer too...

share|improve this answer
1  
1) if you don't disable this. 2,3) yes! it is ALWAYS enumerated and folder hash always is in memory. –  Eir Nym Oct 24 '11 at 11:03

Yes, regular deleting temporary files does seed up your computer, but "amount of speed up" depends on memory, processor and how often is this folder used.

On my old computer I did this every week, on my current - once a month or two. (yes, I have antivirus software)

There's more important is trash bin which should be empty or near to.

share|improve this answer
    
Stating that 'it is more important to empty the trash bin' is a variant on the original question. Why would an empty trash bin be good for performance? Any pointers would be interesting. –  Rabarberski Oct 24 '11 at 13:47
    
Explorer and antiviruses always keep it in mind. With icons, and other information –  Eir Nym Oct 24 '11 at 13:57

While I think the performance increase is fairly small, I see two reasons why it could make a difference:

  • It decreases filesystem fragmentation. Edit: or quite the inverse? see comments
  • It could speed up temporary files scanning and creation for some programs. Some programs create consecutively numbered files (file001.tmp, file002.tmp, ...) in the temp folder, but in order to find out the latest number some simple/stupid approach might be to try each number in order, until a filename is not yet taken. I assume this process takes some time (8 msec for a disk seek according this perhaps outdated reference) if you've accumulated a few years of temporary files.
share|improve this answer
    
I think I understand your second point, but doesn't file deletion actually cause fragmentation? And even if it did decrease the fragmentation, or have some sort of other tangible performance, why would the effect be any different than if you deleted other files outside the temp directory? –  Terribad Oct 24 '11 at 10:58
    
Hmm, good point about deleting the files actually /causing/ fragmentation! –  Rabarberski Oct 24 '11 at 13:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.