Skip to content

Improve performance of path_to_filesystem()#2002

Merged
pbiering merged 4 commits intoKozea:masterfrom
flesueur:master
Mar 1, 2026
Merged

Improve performance of path_to_filesystem()#2002
pbiering merged 4 commits intoKozea:masterfrom
flesueur:master

Conversation

@flesueur
Copy link
Contributor

When using radicale with a large set of accounts, the PROPFIND request at /, even with simple owners_only access rights, is very long (more than 100 seconds with 100% CPU on my test).

The bottleneck seems to be in the function path_to_filesystem() which is called for every folder (so for every account, when listing /), more precisely in the part in which it lists again this large folder.

This patch aims to check the same cases (short names on windows and case-insensitivity) with a different approach. In my test, the PROPFIND at / goes from 120 seconds to 3 seconds.

Copy link
Collaborator

@pbiering pbiering left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you very much

@pbiering pbiering added this to the 3.7.0 milestone Feb 27, 2026
@pbiering
Copy link
Collaborator

flake8 is not happy:

flake8: commands[0]> flake8 .
./radicale/pathutils.py:285:9: F841 local variable 'safe_path_parent' is assigned to but never used
./radicale/pathutils.py:290:11: E128 continuation line under-indented for visual indent

-> please improve your PR, see also https://github.com/Kozea/Radicale/wiki/Development-Testing-Release

@MatthewHana
Copy link
Contributor

Haven't tested it yet but thanks for this @flesueur. I was running into this bottleneck when I was debugging another issue and was going to have a look into the performance degradation later- glad that now I don't have to.

@pbiering
Copy link
Collaborator

pbiering commented Mar 1, 2026

flake8 is not happy:

flake8: commands[0]> flake8 . ./radicale/pathutils.py:285:9: F841 local variable 'safe_path_parent' is assigned to but never used ./radicale/pathutils.py:290:11: E128 continuation line under-indented for visual indent

-> please improve your PR, see also https://github.com/Kozea/Radicale/wiki/Development-Testing-Release

have fixed this now inline

Refactor path collision check for readability.
@pbiering pbiering merged commit 8c0f716 into Kozea:master Mar 1, 2026
28 checks passed
pbiering added a commit that referenced this pull request Mar 1, 2026
@flesueur
Copy link
Contributor Author

flesueur commented Mar 2, 2026

Sorry I was offline during this weekend. Thanks for having cleaned this PR !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants