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

Tag loading #34096

Merged
merged 4 commits into from
Sep 16, 2022
Merged

Tag loading #34096

merged 4 commits into from
Sep 16, 2022

Conversation

kesselb
Copy link
Contributor

@kesselb kesselb commented Sep 15, 2022

If you are a heavy tags user you may run into performance issues.
Especially the user interface is somewhat unusable with a large number of tags.

The tag multi select loads all tags via dav. Filtering is done by select2.
I expect the vue migration to fix some of those issues.

This PR addresses some low hanging fruits:

e1d9b0b: Add minimumInputLength for select2. This will delay the loading of the tags by a few keystrokes. It does not improve the performance but it feels a bit less sluggish. But a minimum input length is also a breaking change and everyone using short tags is probably very unhappy about this 😕 ❓

1bfac6d: When you start typing tags are fetched via xhr. fetched is there to keep track if the data was loaded already. However we have 3 states: not loaded, loading and loaded. If the user continues to type and fetched is false another xhr request is started. This commit is here to address the loading state and prevent another xhr request.

Before After
Screencast from 15.09.2022 12:26:43.webm Screencast from 15.09.2022 16:26:20.webm

79b4c4f: It's an optional change. Adding 10k dom elements put some pressure on my browser. I'm not familiar with select2 and the internals however in my tests I noticed that we emit a deprecation warning for each tag. I rewrote getDescriptiveTag and it seems to help a little bit.

Add 10k tags via occ:

#!/bin/bash

for i in {1..10000}
do
	php occ tag:add "Tag$i" "public"
done

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
When opening the tag select and type something the tags are loaded.

If you continue to type but the tags are not finally loaded yet (the first xhr request is still running)
another xhr request is triggered. This happens for every keystroke.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
For every tag a deprecation warning is emitted.
With 10k tags the ui becomes unresponsive and inspector crashed occasionally.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@kesselb kesselb marked this pull request as ready for review September 15, 2022 15:38
@kesselb kesselb self-assigned this Sep 15, 2022
@kesselb kesselb added bug 3. to review Waiting for reviews labels Sep 15, 2022
Copy link
Member

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

👍

@PVince81 PVince81 merged commit 8880fe3 into master Sep 16, 2022
@PVince81 PVince81 deleted the bug/noid/tag-loading branch September 16, 2022 12:53
@blizzz blizzz mentioned this pull request Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants