Small files very slow to open and save on local drive

notepadperformancessd

SOLVED: There was a bloody shortcut to another PC on my WAN that is inaccessible when I'm not on the VPN. I had forgotten about it. I deleted that, problem INSTANTLY GONE. All files open fast now in all apps. Thanks everyone for all your ideas and time!

Any file I open on my [very fast] PC via File->Open is extremely slow to open, as of the past 3 weeks. This includes (but I'm sure is not limited to):

  • Windows Notepad
  • Notepad++
  • Visual Studio
  • Adobe Photoshop
  • MS Word

Strangely: If I open a file via double-click in file explorer, or open via "recent files list" in any app, it opens instantaneously. The slowness only occurs when doing File->Open from within any application.

Saves are very slow the first time also. Subsequent saves (within the same app session) are very fast.

It takes consistently about 7 seconds each to open any of these small files.

But as described in more detail below, after a file has been opened, then closed in the same session, it opens again instantly. And the slow save only happens on the first-time save, never on subsequent saves.

This problem may coincide with a few events, but may be completely unrelated:

  • the installation of a new M.2 SSD PCIe drive that is widely regarded as blazing fast. I cloned my slower SSD drive and made this new (faster) SSD drive my primary/boot/C drive. That was a few weeks ago. This morning I reverted back (temporarily) to my old SSD (after cloning) and it made no difference. The problem remains. (I even removed the new M.2 drive, booted to the old, and it made no difference.)
  • I upgraded windows 10 to the 2004 version.
  • I enabled Windows Subsystem for Linux (Ubuntu 20.04)

I have found similar posts, but always more understandable scenarios:

Here are a few comparisons and details:

  • Slow to open first time in same session. Slow to save, first save only. Slow saves even happen in Adobe Photoshop, but only on the first save.
  • Windows Defender firewall is running, but realtime protection is turned off, and I don't have any other AV running.
  • Within a given NPP session, if I close a file and then reopen it, it opens instantly. But if I close NPP, relaunch, then open the same file again – it takes 7 seconds. Similar in windows notepad and other text editors.
  • When I open an NPP file from the "recent files" list, any/all those open instantly. It's only when I open files from File->Open that the slowness occurs.
  • If I close NPP and re-launch it, any files that were open in the previous session re-open by default, and it's instantaneous – no delays. It's only when I manually open a file in a new session that the slowness occurs. This is bizarre: I can have 15 files open in NPP and close the app. Then when I relaunch NPP, all 15 files open instantly/automatically in 15 different tabs. But as soon as I do File -> Open and open a file that isn't already opened, it takes 7 seconds and it acts like the whole OS is hung and straining.
  • I uninstalled all my NPP plugins and restarted – still takes 7 seconds to open small text files.
  • I have rebooted my PC several times.
  • I ran chkdsk on the drive where the text files are, no bad sectors.
  • I ran procmon, got results, but don't know what I'm looking for amidst the thousands of entries.
  • I ran wpr – it begins a recording session successfully, but when I run it again with -stop + filename, I get the error cannot change thread mode after it is set.
  • I uninstalled NPP and re-installed it. For about 1 day this solved the problem and files opened instantly. Then the next day the original problem was back again.
  • I ran Optimize against all my drives as per Bob Denton's suggestion below – it made no difference.
  • I did a clean boot (disabled all non-MS services) – no change.
  • I switched the boot sequence to the original SSD drive, shut down, physically removed the brand new M.2 SSD, and booted back up. Same problem. No difference. So it has nothing to do with this new drive. The last culprit I can think of is the Windows 2004 update – nothing else major has changed in the past few months.

This is so annoying. Any ideas?

Best Answer

According to my experience, Windows is quite good in reporting disk hardware errors. Hence, the first thing I would do is opening the event viewer, go to Windows Logs -> System and carefully scroll through through the event list at least a few days in the past, looking at each error. If there is a hardware problem with the disk where the files are located, chances are very good that they will be revealed there.

The second thing that might be worth a try is disabling the virus scanner (just for a short time for a test). I once had a similar problem where it turned out that Windows Defender itself was the problem. You make the impression of an advanced user, so for sure you don't have two or more virus scanners installed, do you?

The third thing I would try is moving a few of the (text) files in question onto your new SSD and to work with them from there. If the times needed for opening / saving are normal then, the old SSD is the problem.

When doing that test, you should remove all other HDDs and SSDs: As noted in one of the comments above, the Windows File Open Dialog might query all drives in the system, and that alone might delay things although you don't open files from one of the other drives.

In the device manager and in the energy management options, you can check whether your drives are always active or whether they are going to sleep. If the latter is the case, you could disable that behavior and test whether the situation changes.

Finally, there eventually is a virus on your system; extreme delays with normal actions would be a typical sign of it. But I actually don't believe this in your case, because (if I got you right) boot times are normal and opening the files is normal as well as soon as they are cached. However, just out of caution, I would boot from a clean read-only medium and check whether there is anything suspicious on the system.

UPDATE (as an answer to the OP's comment)

Your wrote in your comment below:

When I double-click any text file it opens instantly. But when opening it via an app it is very slow.

and

I moved some text files to my [supposedly fast] C drive and the time it takes to open is identical to my other drives.

Both statements support the theory that the standard Windows file open dialog (which application nearly always use to let the user choose a file) has problems when querying the drives.

Therefore, I now recommend to remove all drives (including network drives and USB keys!) except the system drive from the system and re-test. Chances are very good that the problem goes away then. Then you can start re-adding the other drives one by one and identify which one is responsible for the misbehavior.

Of course, you should start with the network drives, because this doesn't require opening the PC. Regarding the network drives, it might not be enough to remove the drive letters for the shares; instead, remove the drive letters, deactivate the network hardware and pull the network cable. Then check whether your application has a non-local file (i.e. a file which is on the network) in its MRU (most recently used) list. If possible, delete the MRU. You need to be sure that the application does not try to search or preload something from the network when opening files from within that application.

If that does not help, proceed with removing the physical drives (USB keys, HDDs, SSDs).

Related Question