Skip to content

Folder as Workspace: High CPU usage when files added in bulk #9203

@CmsWares

Description

@CmsWares

Description of the Issue

When using "Folder as Workspace", if files are added to a subfolder (that need not be open in the view) in bulk on the background (e.g. pasted in via Explorer or written by an application), NP++ makes the CPU run at a full core's worth (or several, if several instances are open), to a point where it becomes unusable and needs to be terminated.

This has become a regular issue with a new routine where I'm clearing and rewriting the (1K+) cache files for an application that has its main folder added into the Folder as Workspace panel. The /cache/whatever/ subfolder is not (ever) open, but is included as one of the many subfolders of the application.

When NP++ is terminated and restarted, I can see all the newly added/generated files included in the subfolder, and this apparently requires next to no CPU or other resources, regardless of the volume of files. There must be something triggering this in the NP++ routine that watches folders on the background.

Steps to Reproduce the Issue

  1. Open a folder with subfolders in "Folder as Workspace"
  2. Copy a large amount of files (say, 1000+) into a subfolder on the background (e.g. via Explorer, or with a shell script that writes a batch of dummy files)
  3. Watch NP++ churning the CPU forever

Expected Behavior

NP++ would be momentarily done with the indexing (?), allowing me to continue writing code.

Actual Behavior

NP++ maxes out the CPU and there's a constant flicker in the "Folder as Workspace" view. I haven't had the patience to see how long this might continue, suffice it to say this goes on and on.

Debug Information

Notepad++ v7.9 (64-bit)
Build time : Sep 22 2020 - 03:19:04
Path : C:\Program Files\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS Name : Windows 10 Pro (64-bit)
OS Version : 2009
OS Build : 19042.572
Current ANSI codepage : 1252
Plugins : AnalysePlugin.dll BigFiles.dll ComparePlugin.dll mimeTools.dll NavigateTo.dll NppConverter.dll nppcrypt.dll NppExport.dll NPPJSONViewer.dll NppTextViz.dll NppXmlTreeviewPlugin.dll pork2sausage.dll PythonScript.dll XMLTools.dll

image

This here routine breaks down a large JSON file into individual objects per file, saved in the /data/tgt/ subfolders (seen in the view). When I wipe and rebuild (PHP + Apache) a couple of thousand items, NP++ chokes on the process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions