Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extremely slow on local LAN #39

Open
cvladan opened this issue May 27, 2021 · 5 comments
Open

Extremely slow on local LAN #39

cvladan opened this issue May 27, 2021 · 5 comments
Labels
Upstream Problem needs to be fixed upstream

Comments

@cvladan
Copy link

cvladan commented May 27, 2021

Files are stored on Raspberry Pi where Home Assistant is installed. I'm using an official Add-on: Samba share to access config .yaml files from Windows 10 desktop computer.

When this plugin is installed in Notepad++, reading is very, really very slow ~ like 4-5 sec. And this lag delay is repeating every time I switch files tabs.

Notepad++ has no problem when this plugin is not installed. Other editors like Notepad, VSCode, ST3 also have no visible problem.

Notepad++ is installed using Scoop package manager with scoop install notepadplusplus

I've solved my problem now but decided to submit this bug ticket to warn and help other Hass.io users that can have similar problems.

@ffes
Copy link
Member

ffes commented May 27, 2021

I've solved my problem now but...

How did you solve the problem?

@cvladan
Copy link
Author

cvladan commented May 28, 2021

I've solved my problem now but...

How did you solve the problem?

Solved by uninstalling editorconfig plugin

@sparrowt
Copy link

sparrowt commented Jul 29, 2021

If the slowness is happening on every tab switch, perhaps the plugin isn't caching the results of this search on a per-tab basis and is instead searching for (and reading) .editorconfig files every time you switch between files.

Yep, looking at src/NppPluginEditorConfig.cpp it seems the entire loading process happens every time NPPN_BUFFERACTIVATED happens, which according to src/Notepad_plus_msgs.hpp is

// To notify plugins that a buffer was activated (put to foreground).

So on every tab switch it does: loadConfig > parseConfig > (editorconfig-core-c) editorconfig_parse > get_filenames which is going to be slow if traversing network shares.

The spec at https://editorconfig.org/#file-location says:

When opening a file, EditorConfig plugins look for a file named .editorconfig in the directory of the opened file and in every parent directory.

so it seems this should only be done once when a file is opened?

@lowjoel
Copy link

lowjoel commented Oct 23, 2023

Furthermore, it seems like the plugin is traversing all the way up to the server of a UNC share. i.e.:

   \\server\path\file.txt
-> \\server\path\.editorconfig
-> \\server\.editorconfig
-> \\.editorconfig

The last 2 of which should never be attempted because the UNC paths have to be a directory, and the toplevel refers to a host. Imagine a host being called .editorconfig (not legal, but can't guess what happens...)

Edit: It seems to be within the core editorconfig library: https://github.com/editorconfig/editorconfig-core-c/blob/082268b/src/lib/editorconfig.c#L519, the path splitting algorithm isn't UNC-aware.

@ffes
Copy link
Member

ffes commented Oct 23, 2023

Thanks @lowjoel for the great feedback. I have opened editorconfig/editorconfig-core-c#98 in the core-c repo to report this problem.

@ffes ffes added the Upstream Problem needs to be fixed upstream label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Upstream Problem needs to be fixed upstream
Projects
None yet
Development

No branches or pull requests

4 participants