artgris / FileManagerBundle

FileManager is a simple Multilingual File Manager Bundle for Symfony
MIT License
175 stars 90 forks source link

Media Manager is very slow with a large quantity of images #75

Open alexandru-burca opened 4 years ago

alexandru-burca commented 4 years ago

Hello,

My project have a folder with around of 400 000 images in other 20 folder filled with images. When I try to open the "Media Manager" it takes around of 5 minutes to load the page [and my mac goes crazy ].

I saw that the tool supports lazy loading but even with lazy loading 400 000 seems to be too much for it.

Is there any setting that I am missing? Please advice?

Thank you very much for this tool.

artgris commented 4 years ago

Hi, In my last release, you can add a twig_extension to handle image preview:

https://github.com/artgris/FileManagerBundle/blob/master/Resources/doc/book/1-basic-configuration.md#twig_extension-to-apply-a-twig-filter-or-a-twig-function-to-preview-images

and resize (for example) image preview

artgris commented 4 years ago

or if you don't need a preview, override my template and delete the column.

alexandru-burca commented 4 years ago

Thank you @artgris but even with a filter that crops my images to 20px20 it takes around of 2min and more than 526 alocated memory to load the images.

And even after I override the template "preview.html.twig" the loading time remain the same.

Maybe the best solution here will be to add pagination and load only 20 or a user specified number of images per page. What do you think about that, is this a feature that can be easily integrated?

Thank you

bozhidargyurov commented 3 years ago

I'm hitting similar issues even with a smaller amount of images. Maybe the best approach is to add a pagination. And a configuration option to disable crawling the subdirectories of the main folder (which is used from the configuration), so that you can use a folder only on one level.

Martin1982 commented 2 years ago

This might be improved if https://github.com/artgris/FileManagerBundle/pull/98 gets approved. No silver bullet yet though.

show_file_count: false will hide the number of files per directory, but also disables the calculation which seemed to be quite costly