Hello Community,
Jerry reported performance problems related to determining the image usage in the filebrowser. I've made an improvement, which seems to be ok for a moderate content size and a moderate amount of images in a single folder (r278).
But then I've made same benchmark tests with a relatively large content (~500 KB; 155 pages with 5 images each). Calling the filebrowser on images/flags/ (19 files) is approximately 16 times slower than for the empty images/! 90% of the time is spent calling preg_match() in Filebrowser::fileIsLinked(), as this function is called number_of_files_in_folder * number_of_pages times (in this case 2945 times!).
As this content size and the number of images shouldn't be too unusual, I still consider the performance barely acceptable. So I have rewritten the usage detection. This slows down the filebrowser a bit (in the test case about 20%), even if there are no images in the folder, but doesn't take much more time, even if there are many images.
I would prefer the latter solution, but it is barely tested. So what should we do?
Christoph
PS: for reference: the issue about missing usage information was reported in a German thread.
Filebrowser: Display Image Usage
Filebrowser: Display Image Usage
Christoph M. Becker – Plugins for CMSimple_XH
-
- Posts: 155
- Joined: Thu Oct 06, 2011 7:00 am
Re: Filebrowser: Display Image Usage
Hi Christopher
In this case I will prefer the later solution supplied with an option to disable image tracking.
In this case I will prefer the later solution supplied with an option to disable image tracking.
Re: Filebrowser: Display Image Usage
Hi Jerry,
thanks for giving your opinion Indeed that seems to be reasonable, perhaps even defaulting not to track the image usage?
BTW: thanks for the wording "image tracking". I really like it.
Christoph
thanks for giving your opinion Indeed that seems to be reasonable, perhaps even defaulting not to track the image usage?
BTW: thanks for the wording "image tracking". I really like it.
Christoph
Christoph M. Becker – Plugins for CMSimple_XH
-
- Posts: 155
- Joined: Thu Oct 06, 2011 7:00 am
Re: Filebrowser: Display Image Usage
Hi Christoph
Why to hide a useful functionality (it was avialable for CMSimple since File Administration plugin). I would certainly prefer that the image tracking is on by default. Off setting makes only sense if you expect problems on websites with lots of content. Otherwise, drop an option to turn off the image tracking.
Why to hide a useful functionality (it was avialable for CMSimple since File Administration plugin). I would certainly prefer that the image tracking is on by default. Off setting makes only sense if you expect problems on websites with lots of content. Otherwise, drop an option to turn off the image tracking.
Re: Filebrowser: Display Image Usage
I've made some tests with the new image tracking routine acting on a very large content file (4.5 MB). In this case calling the filebrowser takes about 50% more time than without image tracking, which seems acceptable regarding such large content. For typical content sizes the overhead is much lower (see above), and so I assume we can do without a config option to disable it.
Christoph M. Becker – Plugins for CMSimple_XH
-
- Posts: 155
- Joined: Thu Oct 06, 2011 7:00 am