Repository navigation
Improve loading performance of large folders and network mounts - #3825
paulvandenburg wants to merge 3 commits into
Conversation
…rantly. free_location_change() null-checks slot->new_content_view, then calls nemo_view_stop_loading() on it. That removes the view's directory monitor, which runs the directory's async state machine and can emit signals that come back round to free_location_change() for the same slot. The reentrant call clears and unrefs slot->new_content_view, so when the outer call resumes it hands NULL to nemo_window_disconnect_content_view(), which asserts on it and aborts.
|
Latest commit also fixes a crash I encountered, under certain conditions I'm not fully sure of with back/forth navigation and view refreshing. Not sure if it was introduced here, but this hopefully fixes it. |
|
This seems very 'bolted on'. While I think there are probably improvements that could be made related to mime-type detection, I'd prefer to work with nemo's existing machinery. For example there is already a mechanism for deferred attribute loading that is ignored here. Smaller and more incremental PRs are also better and more likely to be merged. Something like this I can just as easily do myself and have more faith in the outcome. |
Well I'd welcome your version of this performance improvement to nemo too. As I said I'm not familiar with the already available options in the code base. However I do know from running this on my machine that the performance gain is very significant and so far without issues. The currently shipped version of nemo is basically unworkable with folders with large file counts on network mounts, but with this change it is fast and responsive. Though I'm happy with any change that brings a similar end result. |
Context:
I noticed that opening folders with lots of files, especially from a network mount (SMB), was very slow and while loading the files shown would jump around as newly loaded files were inserted between the previously shown files. Opening the same folder mounted in Windows was fast, so I wanted to fix this.
For context I used these folders for my tests:
SMB notes, I use mostly default settings for the mounted folder. Of note is that rsize was at 4MB (default).
The relevant network setup is that the server is at home (wired connection), that I'm trying to access from my laptop over WIFI (stable/strong signal). So near optimal conditions.
Nemo settings are mostly default. Thumbnail generation is set to
Yesso those are also generated for network mounts.Steps taken:
lsin the CLI. Wheretime ls /mnt/lots-o-filesshows a real time of0,3sbut atime ls -l /mnt/lots-o-filesgives11,8s. Explained by the second needing to get file stats for each, needing a network round trip per file, getting slow even on a fast connection with large file numbers.To avoid the
rsizevalue causing a 4MB load regardless,posix_fadviseis used to only get the necessary bytes.Results:
Considerations:
Notes:
.editorconfigin the project, added one that I think reflects those standards, which I included in a separate commit. Can be removed. Did notice the existing code contained quite a few whitespace at the end of lines, tried to not include the cleanup of those here.