Speed extremely slow with populating relation dropdown (several minutes)
See original GitHub issueDescribe the bug We have a template that uses four different list fields - each one allowing the administrator to specify any number of items from a collection to be displayed on a page. The list is defined with a relation field widget, similar to the code below. When there were fewer than 30 items in the respective collections and fewer than 5 or so items selected for each of the four lists this was slow, but acceptable (taking a second or two to populate the relation field dropdown). With 140 and 60 items in each of the referenced collections (stories and news), and 77 selected from one collection and 8 from the smaller collection the waiting time for drop-down population seems to be on the order of several minutes, and this population takes place every time a new item is added to the list, or an item’s relation drop-down is clicked to edit it. There seems to be no caching of values between drop-downs despite pulling from the same source:
- label: "Featured Stories⁺"
singular_label: "Featured Story"
hint: "⁺will be displayed in the order provided above."
name: "featured_stories"
widget: list
ui: fields
required: true
allow_add: true
fields:
- label: "Altas post/story"
name: "story"
widget: "relation"
collection: "atlas"
search_fields: ["title"]
value_field: "uuid"
display_fields: ["title", "thumb_new"]
hint: "Start typing the title of the Atlas post/story then select from the dropdown list"
- {label: "Don't show thumbnail in list", name: "no_thumb", widget: "boolean", default: false, required: false}
To Reproduce
- Create a collection of 150 items,
- Create a field with the above displayed definition, referencing this collection
- Start adding items to the list and watch the performance take longer and longer until it’s basically unusable for the average site editor
Expected behavior I would expect that the performance for selecting in this sort of situation be good enough at least through a thousand or more items in the collection and at least a few hundred or more items selected from that collection
Applicable Versions:
- netlify-cms-app 2.15.54
- netlify-cms-core 2.53.0
- netlify-cms 2.10.174
- Git provider: Gitlab (was also a problem on Github, though may have been very slightly faster on github)
- OS: Windows 10, Linux, MacOS
- Browser version Chrome, Firefox, Safari (all the most recent versions)
CMS configuration See relevant snipet, above
Additional context If required, we can provide a copy of the repository with all config and collection files for analysis to a Netlify CMS engineer (not for direct public release)
Issue Analytics
- State:
- Created 2 years ago
- Comments:33 (13 by maintainers)
Top GitHub Comments
We still find this a crippling problem for editors, taking minutes (tens of minutes) for relationship fields (relation widgets, displayed as a type of custom drop-down) to populate in trying to select a post in a page. We have tried things like paring down the git repository, ensuring that editors have good amounts of memory for caching, etc.
In the most recent trials I have done as a developer who sees the issues on my machine, too, I have found that the issue is no longer requests being made from the browser on the initial use of a relationship field. In fact, I have always told the editors to give the CMS a few minutes (10-15 or more) to populate the cache after the first time they connect, so that all data can be cached properly. This seems to happen.
Once the cache is populated, however, the drop-down relation widget still take 10-15 minutes to populate (or more, depending on computer and browser) the first time one is used (remember, we use relation widgets as part of a list widget, so adding another relation to the list after one has already been added successfully works much faster). The second time a relation is added to the list and a portion of title typed, the drop-down populates within 5-10 seconds.
However, using the same template, or coming back to the same page within the same editing session, the initial population time returns to 10-15 minutes or more.
During all of this drop-down (relation widget) population time, there is almost no network traffic. None, in fact, other than a occasional “user” ping once every 5 minutes.
So this population time is all some sort of JavaScript processing, completely unrelated to Gitlab network traffic and responses.
@erezrokah
We tried 2.10.183 on an instance where we have this structure: List > Object > List > Objects with relation field. We host our own Gitlab. Each relation points to 50 to 100 files. I definitely see an improvement in speed when loading the form although there is still some loading time when revealing the last object widget and until the relations are displayed in the relation widget. It’s not snappy but it makes this form usable for us again.
Let me know if you want me to supply additional debugging information. Many thanks!