plan2net / webp

Create a WebP copy for images (TYPO3 CMS)
GNU General Public License v3.0
60 stars 34 forks source link

Hundreds of queries to check for failed attempts really neccesary? #42

Closed bernhardberger closed 3 years ago

bernhardberger commented 3 years ago

https://github.com/plan2net/webp/blob/c094f9fc2e294a68c68c43d3be7caf3e47be2bf1/Classes/Service/Webp.php#L47

Is this check really neccesary? This causes a butload of queries.

My scenario:

Results in: 500 * 1000 = 0.5 mio queries per minute for that check alone.

Can this be optimized? I'm happy to submit a PR if anyone suggest an approach..

wazum commented 3 years ago

Merged https://github.com/plan2net/webp/commit/261f861c10926bdd3e49df57b28f80705fdfbab7 Should be a lot faster now, but why would heavy traffic have any impact on this? The images are generated usually once (see https://github.com/plan2net/webp/blob/c094f9fc2e294a68c68c43d3be7caf3e47be2bf1/Classes/EventListener/AfterFileProcessing.php#L63). Maybe you can give some insights into your setup, why processing these images would be called all the time?

infabo commented 3 years ago

Maybe you can give some insights into your setup, why processing these images would be called all the time?

Would be interested too

infabo commented 3 years ago

Is this check really neccesary? This causes a butload of queries.

btw, it is buttload