I'm desperately looking for cheap ways to lower the build times on my home PC. I just read an article about disabling the Last Access Time attribute of a file on Windows XP, so that simple reads don't write anything back to disk.
It's really simple too. At a DOS-prompt write:
fsutil behavior set disablelastaccess 1
Has anyone ever tried it in the context of building C++ projects? Any drawbacks?
[Edit] More on the topic here.
The Last Access Time attribute is the date and time a file or folder was last accessed in Windows. Last Access Time updating is enabled by default in XP. In order to save system resources, it is disabled by default in Vista, Windows 7, and Windows 8.
To Enable or Disable "Last Access Time" in a Command Prompt. 1. Open an elevated command prompt. NOTE: For Windows 8, see also: Elevated Command Prompt - Open in Windows 8. 2. Do either step 3 or 4 below for what you would like to do.
Having the Last Access Time stamp enabled on an older or slower computer may cause file access to take longer. This tutorial will show you how to enable or disable the NTFS Last Access Time stamp updates for all users in Windows 10. You must be signed in as an administrator to enable or disable the Last Access Time stamp.
Follow these steps: Open the Registry Editor (Regedit.exe). Browse to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem. Look for NtfsDisableLastAccessUpdate. If it doesn’t exist, add this DWORD and set its value to 1, which will disable the process. Close the Registry Editor, and reboot the server.
From SetFileTime's documentation:
"NTFS delays updates to the last access time for a file by up to one hour after the last access."
There's no real point turning this off - the original article is wrong, the data is not written out on every access.
EDIT:
As to why the author of that article claimed a 10x speed-up, I think he attributed his speed-up to the wrong thing: he also disabled 8.3 filename generation. To generate an 8.3 filename for a file, NTFS has to basically generate each possibility in turn then see if it's already in use (no reference; I'm sure Raymond has talked about it but can't find a link). If your files all share the same first six characters, you will be bitten by this problem, and the corrolary is you should put characters which differentiate files in the first six characters so they don't clash. Turning off short name generation will prevent this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With