#109411Load multiple image variants at once
Description
Load multiple variants of the same image at once to improve performance and load on db.
With html picture source-sets there are lots of variants (like `200w, 400w, 600w, 800w, 1000w, 1200w`) of the same image which needs to be loaded at once.
A real page showing a list of news-articles might have like- 35 pictures in total (25 for the news-list plus 10 extra)
- two source-sets of 10 images per picture (one for density
1xand one for2x)
—> This currently results in 700 pictures and 700 SQL queries, which could be reduced to 70 SQL queries.
——
E.g. a page – showing 3 pictures in 6 variants only – needs already 18 queries to get the images from sys_file_processedfile:
Current – first load with image creation
| _.SQL Query | _.Count | _.Total Time [ms] |
|---|---|---|
| Total | 49 | 30.83 |
SELECT * FROM `sys_file_processedfile` WHERE (`original` = ?) AND (`task_type` = ?) AND (`configurationsha1` = ?) |
18 | 13.03 |
INSERT INTO `sys_file_processedfile` (`width`, `height`, `checksum`, `name`, `identifier`, `storage`, `configuration`, `task_type`, `configurationsha1`, `original`, `originalfilesha1`, `crdate`, `tstamp`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) |
18 | 10.99 |
Current – clear cache reload
| _.SQL Query | _.Count | _.Total Time [ms] |
|---|---|---|
| Total | 31 | 14.94 |
SELECT * FROM `sys_file_processedfile` WHERE (`original` = ?) AND (`task_type` = ?) AND (`configurationsha1` = ?) |
18 | 8.00 |
——
With the optimized implementation the same page needs 3 queries only to get the images from sys_file_processedfile:
New – first load with image creation
| _.SQL Query | _.Count | _.Total Time [ms] |
|---|---|---|
| Total | 34 | 22.00 |
INSERT INTO `sys_file_processedfile` (`width`, `height`, `checksum`, `name`, `identifier`, `storage`, `configuration`, `task_type`, `configurationsha1`, `original`, `originalfilesha1`, `crdate`, `tstamp`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) |
18 | 10.99 |
SELECT * FROM `sys_file_processedfile` WHERE (`original` = ?) AND (`task_type` = ?) AND (`configurationsha1` IN (?, ?, ?, ?, ?, ?)) |
3 | 2.99 |
| … | … | … |
New – clear cache reload
| _.SQL Query | _.Count | _.Total Time [ms] |
|---|---|---|
| Total | 16 | 9.99 |
SELECT * FROM `sys_file_processedfile` WHERE (`original` = ?) AND (`task_type` = ?) AND (`configurationsha1` IN (?, ?, ?, ?, ?, ?)) |
3 | 1.84 |
| … | … | … |
Reviews 3
Related issues 1
History 210
-
Ayke Halder changed Related to #102215 <span data-processor="relativetime" data-value="2026-03-27T18:15:29+00:00" > 03/27/26, 18:15 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 93372 status
NewUnder Review <span data-processor="relativetime" data-value="2026-03-27T18:23:20+00:00" > 03/27/26, 18:23 </span> -
Gerrit Code Review pushed patch set 1 for main to change 93498 <span data-processor="relativetime" data-value="2026-03-31T16:59:20+00:00" > 03/31/26, 16:59 </span>
-
Gerrit Code Review pushed patch set 2 for main to change 93498 <span data-processor="relativetime" data-value="2026-04-02T09:32:15+00:00" > 04/02/26, 09:32 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 93498 <span data-processor="relativetime" data-value="2026-04-22T06:45:00+00:00" > 04/22/26, 06:45 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 93498 <span data-processor="relativetime" data-value="2026-06-11T23:38:10+00:00" > 06/11/26, 23:38 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 93498 <span data-processor="relativetime" data-value="2026-06-12T11:20:38+00:00" > 06/12/26, 11:20 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 94603 <span data-processor="relativetime" data-value="2026-06-26T16:36:03+00:00" > 06/26/26, 16:36 </span>
-
Gerrit Code Review pushed patch set 2 for 14.3 to change 94603 <span data-processor="relativetime" data-value="2026-07-15T13:56:34+00:00" > 07/15/26, 13:56 </span>
-
Ayke Halder commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-07-15T14:45:09+00:00" > 07/15/26, 14:45 </span>
Applied in changeset commit:32a729defc51a72cc935440dbb3ac7e7182f3473.