question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Speed extremely slow with populating relation dropdown (several minutes)

See original GitHub issue

Describe 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

  1. Create a collection of 150 items,
  2. Create a field with the above displayed definition, referencing this collection
  3. 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:open
  • Created 2 years ago
  • Comments:33 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
delwincommented, Jul 4, 2022

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.

1reaction
lorenzodecommented, Jan 6, 2022

@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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extremely Slow - Power Platform Community - Microsoft
Is anyone else finding flow slow to use.. It akes around a minute to expand any action or condition, another minute to populate...
Read more >
Why is my SQL Server Query Suddenly Slow? | How To Fix
The reason we're now getting 2000 executions per minute instead is because, in the blink of an eye, the query started running in...
Read more >
Slow Google Sheets? Here are 27 Ideas to Try Today
Slow Google Sheets? Follow these 27 techniques to diagnose and improve the performance of even the worst performing Google Sheets.
Read more >
Entity-framework code is slow when using Include() many times
tl;dr Multiple Include s blow up the SQL result set. Soon it becomes cheaper to load data by multiple database calls instead of...
Read more >
Why is my internet so slow? 11 ways to speed up your ... - ZDNet
Are you suffering from slow internet speeds at home? ... and check to see if your slow speed or failed connection to a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found