Skip to content

Improve thumbnail generation performance #2

@tomsaleeba

Description

@tomsaleeba

Steps:

  • start server
  • post an image
  • request original size image
  • add ?thumbnail=True querystring

Expected behaviour:
The thumbnail is generated and returned to the caller "quickly". Exactly what "quickly" means in debatable but ideally less than 1 second or at least within 5 seconds.

Actual behaviour:
Running with the following setup:

  • Core i7 desktop with SSD and 16GB memory
  • running in uwsgi
  • a 5mb JPG posted initially

It took 217 seconds to generate the default sized thumbnail and 221 seconds to generate a xsize=300 thumbnail.

The thumbnail creation process also seems to ruin the image. As an example, here is an image requested with ?xsize=400&thumbnail=False:
chicken-400px
...and here's the same image request with ?xsize=400&thumbnail=True, we've just flipped the flag to ask for a thumbnail:
chicken-400px-thumbnail
It's distorted the image. This is using the default for thumbnail creation in the config.

More details:
It seems that you don't need to include the thumbnail param to generate a smaller size image. You can just supply xsize and ysize and it responds quickly. Perhaps we don't need the thumbnail mode?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions