eyra / mono

Next platform repo
https://eyra.co
GNU Affero General Public License v3.0
7 stars 4 forks source link

Brief high cpu usage when opening storage card with 900+ files #912

Closed TjerkNan closed 2 months ago

TjerkNan commented 2 months ago

Describe the bug According to 'htop' on the dev web server, both (all) cpu cores are at 80+ percent usage when opening the internal storage card of a project, if there are 1000 files.

Truth be told, this is on a lower spec dev host with 1 GB RAM (no issue) and 2 cheaper cores.

To Reproduce Steps to reproduce the behavior:

  1. upload 1000 files to the internal storage of a project
  2. click on the storage card and simultaneously observe htop through ssh on our dev webserver

Expected behavior Much lower cpu usage as it may interfere with application responsiveness for participants

Screenshots N/A

Desktop (please complete the following information):

mellelieuwes commented 2 months ago

@TjerkNan to prevent rendering lots of items on the screen we decided to slightly change the idea of the file browser with the following rules:

  1. The browse function has changed to a preview function.
  2. Sorting is based on date: new -> old (most recent first)
  3. Never more than 100 file items are rendered (100 is arbitrary, but hardcoded)
  4. If no search query is entered, the 100 (or less) most recent ones are rendered
  5. If a search query is entered, the query results are rendered with a max of 100 items

Image

Image

TjerkNan commented 2 months ago

@emielvdveen I still observe a CPU spike across both cores, but it's brief just a second so I think it's ok.

mellelieuwes commented 2 months ago

@TjerkNan is the performance approved since original situation?

TjerkNan commented 2 months ago

@emielvdveen It's using both cores for 50% just a brief second or so. I didn't record the initial performance unfortunately so I can't be 100% sure if things changed but I think it's good enough for now, especially because it's not 100%.

mellelieuwes commented 2 months ago

Lets keep an eye on this