Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating and storing unnecessary data #25

Open
curtchan opened this issue Jan 11, 2019 · 3 comments
Open

Generating and storing unnecessary data #25

curtchan opened this issue Jan 11, 2019 · 3 comments

Comments

@curtchan
Copy link

Analyzed whole thumbnail generating flow.

I'd suggest, instead of generating 4 thumbnails - generating only one + storing type of it.

If user changes in config thumbnail type - notify that images require regenerating.

It should speed up whole generating process and limit DB usage.

@curtchan curtchan changed the title Generating obsolete data Generating and storing obsolete data Jan 11, 2019
@curtchan curtchan changed the title Generating and storing obsolete data Generating and storing unnecessary data Jan 11, 2019
@Lorti
Copy link
Owner

Lorti commented Jan 11, 2019

I personally don't mind the few extra bytes, and WordPress itself is very generous when it comes to storing images. Also you don't have to wait for regeneration of all your images when switching to a different placeholder style.

I do understand that there's a lot of data created, especially on image-heavy sites or large blogs, but I have a feeling that there are other areas for optimization, with a larger lever.

@curtchan
Copy link
Author

Well, i'm always looking at such things from optimization point of view, keeping in mind that some websites i deal with have thousands of images, iterating through each and instantiating 4 Imagick objects (and operating on them) will definitely take longer than doing same just once if needed, would have to stress-test it though to see if the difference is worth rewriting it.

$dominant_color = $this->calculate_dominant_color( $path );

@Lorti
Copy link
Owner

Lorti commented Jan 14, 2019

I’m also using the plugin on a page with thousands of images. The regeneration was only necessary once at the beginning. When uploading new pictures the dominant color calculation and thumbnail generation isn’t noticeable. If I ever want to switch to a different placeholder style it happens instantaneously.

Your suggestion is worth looking into, but I personally don’t have the time for it right now. I'd be happy if you or the community wants to take this on ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants