Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-8853

Extremely Slow Performance Manually Editing Document to Remove Element of Array

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: CRUD, Performance
    • None
    • Environment:
    • 5
    • Developer Tools

      Problem Statement/Rationale

      When clicking the pencil icon to manually edit a document, I have a use-case where occasionally I want to manually remove the last element of an array within a document. The array length ranges from 0 to a few hundred.

      While the array is still easily below 100 in length, MongoDB Compass will freeze and become unresponsive for several minutes (roughly 5 -> 10 minutes). During this time, MongoDBCompass consistently consumes ~25% of my CPU (measured on task manager), so it seems like there is some time being spent on a bug. Most recently I observed this with an array length of 83.

      Please be sure to attach relevant logs with any sensitive data redacted.
      How to retrieve logs for: Compass; Shell

      {_}compass_678ec6a9657e440d3e05ce7e_log.txt
      {_}I retrieved this by going Help -> Open Log File -> Open as .TXT in Compass.

      Steps to Reproduce

      How could an engineer replicate the issue you're reporting?

      1. make a document with a size of approximately 20kb (unsure if it's relevant, but that's roughly where my documents are at). Make the document have an array property on it, with ~100 elements in it. Each element should be an object of some reasonable size and complexity. Here is what an example entry looks like for me:

        2. Click the pencil icon in the top-right:
        3. Scroll down, and delete the last element of the array:

      4. Click 'Update'

      5. Observe the application UI freezing for an unreasonable amount of time, no warning or error message, and high CPU usage.

      Expected Results

      What do you expect to happen?

      I would expect that this operation should not take 5-10 minutes to complete. If it were to take that long, I would not expect it to be eating 25% CPU for this entire time, if it had to wait for the MongoDB server to complete something. If there were no way to prevent this, I would expect a warning before clicking 'Update', given that it renders the application unusable for several minutes.

      Actual Results

      What do you observe is happening?

      I am observing it take 5-10 minutes, high CPU usage, and a frozen UI.

      Additional Notes

      Any additional information that may be useful to include.

        1. compass_678ec6a9657e440d3e05ce7e_log.txt
          29 kB
        2. example mongodb document.txt
          560 kB
        3. image-2025-01-20-21-50-57-814.png
          image-2025-01-20-21-50-57-814.png
          30 kB
        4. image-2025-01-20-21-51-23-038.png
          image-2025-01-20-21-51-23-038.png
          14 kB
        5. image-2025-01-20-21-52-06-982.png
          image-2025-01-20-21-52-06-982.png
          11 kB

            Assignee:
            Unassigned Unassigned
            Reporter:
            hayashi.nicholas@gmail.com Nicholas Hayashi
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: