FileManagerBundle icon indicating copy to clipboard operation
FileManagerBundle copied to clipboard

Media Manager is very slow with a large quantity of images

Open alexandru-burca opened this issue 5 years ago • 5 comments

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.

alexandru-burca avatar Sep 30 '20 19:09 alexandru-burca

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 avatar Oct 01 '20 06:10 artgris

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

artgris avatar Oct 01 '20 06:10 artgris

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

alexandru-burca avatar Oct 01 '20 11:10 alexandru-burca

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.

bozhidargyurov avatar Oct 25 '20 08:10 bozhidargyurov

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

Martin1982 avatar Feb 09 '22 15:02 Martin1982