owncloud / notes

:notebook_with_decorative_cover: Notes app for ownCloud
GNU Affero General Public License v3.0
194 stars 46 forks source link

Very slow to load the notes list #197

Open xdmx opened 8 years ago

xdmx commented 8 years ago

Steps to reproduce

  1. create many notes (I have 60)
  2. load the notes

    Expected behaviour

It quickly loads the list of notes in the left menu

Actual behaviour

It takes about 18 seconds to load the list, a single note opens in 800 ms

Server configuration

Operating system: Ubuntu 14.04

Web server: Scaleway instance with nginx

Database: mysql 5.5.47

PHP version: 5.6.17

ownCloud version: (see ownCloud admin page) 8.2.2

xdmx commented 8 years ago

Now I have many more notes and it's taking 30 seconds to load the notest list.

Checking the response of the notes call I see that it returns the content of all notes. I think that the problem is exactly this, scaleway has a quite slow hard drive (connected to the network, not directly to the server) which takes a little bit to load each file and it also has to decrypt each note at every request.

Checking the code it seems that the index loads each file and thus it takes a lot of time increasing exponentially (https://github.com/owncloud/notes/blob/master/service/notesservice.php#L49) and then the get response loads that file again.

Since the name of the file is the title of the note, why does it load the content of all notes as well? Shouldn't it load only the list of files instead?