Thanks for this suggestion, I’ve compiled the faster-lighttable branch and tested. There is some change, but unfortunately it didn’t solve the slow responsiveness problem. Although it helped with the high CPU usage when mouse moves only within the same thumbnail:
On regular dt 2.4.1 log like this (with “-d all”) keeps repeating whenever mouse moves inside one thumb:
[sql] /build/darktable-CEnZBI/darktable-2.4.1/src/common/image.c:632, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0244 sec
[sql] /build/darktable-CEnZBI/darktable-2.4.1/src/common/image.c:632, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0248 sec
[sql] /build/darktable-CEnZBI/darktable-2.4.1/src/common/image.c:632, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0284 sec
[sql] /build/darktable-CEnZBI/darktable-2.4.1/src/common/image.c:632, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0305 sec
[sql] /build/darktable-CEnZBI/darktable-2.4.1/src/common/image.c:632, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0270 sec
[sql] /build/darktable-CEnZBI/darktable-2.4.1/src/common/image.c:632, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0253 sec
[sql] /build/darktable-CEnZBI/darktable-2.4.1/src/common/image.c:632, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0249 sec
[sql] /build/darktable-CEnZBI/darktable-2.4.1/src/common/image.c:632, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0245 sec
[sql] /build/darktable-CEnZBI/darktable-2.4.1/src/common/image.c:632, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0134 sec
[sql] /build/darktable-CEnZBI/darktable-2.4.1/src/common/image.c:632, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0134 sec
[sql] /build/darktable-CEnZBI/darktable-2.4.1/src/common/image.c:632, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0141 sec
[sql] /build/darktable-CEnZBI/darktable-2.4.1/src/common/image.c:632, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0156 sec
[mipmap_cache] thumbs fill 98,88/2048,00 MB (4,83%)
[mipmap_cache] float fill 0/4 slots (0,00%)
[mipmap_cache] full fill 1/4 slots (25,00%)
[mipmap_cache] level | near match | miss | stand-in | fetches | total rq
[mipmap_cache] thumb | 3,23% | 3,23% | -nan% | 0,00% | 100,00%
[mipmap_cache] float | -nan% | -nan% | -nan% | 0,00% | 0,00%
[mipmap_cache] full | -nan% | -nan% | -nan% | 100,00% | 0,00%
[lighttable] expose took 0,2732 sec
With faster-lighttable log changes to only this (again, repeating while mouse moves):
[lighttable] expose took 0,0000 sec
Also the CPU consumption went down from ~200% to ~40% (on a quad-core intel i5). This does not affect the user experience much, but indeed lowers the overall CPU usage.
Hovever when moving between thumbs (with mouse or with an arrow key) the CPU usage is still around 200% and this is logged once on every jump to a neighbouring thumb:
[sql] /home/mimo/tmp/dt/darktable/src/libs/metadata_view.c:222, function _metadata_view_update_values(): prepare "SELECT imgid FROM main.selected_images LIMIT 1"
[sql] /home/mimo/tmp/dt/darktable/src/common/image.c:151, function dt_image_film_roll(): prepare "SELECT folder FROM main.film_rolls WHERE id = ?1"
[sql] /home/mimo/tmp/dt/darktable/src/common/image.c:196, function dt_image_full_path(): prepare "SELECT folder || '/' || filename FROM main.images i, main.film_rolls f WHERE i.film_id = f.id and i.id = ?1"
[sql] /home/mimo/tmp/dt/darktable/src/common/metadata.c:179, function dt_metadata_get_xmp(): prepare "SELECT value FROM main.meta_data WHERE id = ?1 AND key = ?2 ORDER BY value"
[sql] /home/mimo/tmp/dt/darktable/src/common/metadata.c:179, function dt_metadata_get_xmp(): prepare "SELECT value FROM main.meta_data WHERE id = ?1 AND key = ?2 ORDER BY value"
[sql] /home/mimo/tmp/dt/darktable/src/common/metadata.c:179, function dt_metadata_get_xmp(): prepare "SELECT value FROM main.meta_data WHERE id = ?1 AND key = ?2 ORDER BY value"
[sql] /home/mimo/tmp/dt/darktable/src/common/tags.c:351, function dt_tag_get_attached(): prepare "SELECT DISTINCT T.id, T.name FROM main.tagged_images AS I, data.tags AS T WHERE I.imgid IN (SELECT imgid FROM main.selected_images) AND T.id = I.tagid ORDER BY T.name"
[sql] /home/mimo/tmp/dt/darktable/src/common/image.c:675, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0248 sec
[sql] /home/mimo/tmp/dt/darktable/src/common/image.c:675, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0246 sec
[sql] /home/mimo/tmp/dt/darktable/src/common/image.c:675, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0256 sec
[sql] /home/mimo/tmp/dt/darktable/src/common/image.c:675, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0274 sec
[sql] /home/mimo/tmp/dt/darktable/src/common/image.c:675, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0268 sec
[sql] /home/mimo/tmp/dt/darktable/src/common/image.c:151, function dt_image_film_roll(): prepare "SELECT folder FROM main.film_rolls WHERE id = ?1"
[sql] /home/mimo/tmp/dt/darktable/src/common/image.c:196, function dt_image_full_path(): prepare "SELECT folder || '/' || filename FROM main.images i, main.film_rolls f WHERE i.film_id = f.id and i.id = ?1"
[sql] /home/mimo/tmp/dt/darktable/src/common/metadata.c:179, function dt_metadata_get_xmp(): prepare "SELECT value FROM main.meta_data WHERE id = ?1 AND key = ?2 ORDER BY value"
[sql] /home/mimo/tmp/dt/darktable/src/common/metadata.c:179, function dt_metadata_get_xmp(): prepare "SELECT value FROM main.meta_data WHERE id = ?1 AND key = ?2 ORDER BY value"
[sql] /home/mimo/tmp/dt/darktable/src/common/metadata.c:179, function dt_metadata_get_xmp(): prepare "SELECT value FROM main.meta_data WHERE id = ?1 AND key = ?2 ORDER BY value"
[sql] /home/mimo/tmp/dt/darktable/src/common/tags.c:333, function dt_tag_get_attached(): prepare "SELECT DISTINCT T.id, T.name FROM main.tagged_images AS I JOIN data.tags T on T.id = I.tagid WHERE I.imgid = 4430 ORDER BY T.name"
[sql] /home/mimo/tmp/dt/darktable/src/common/image.c:675, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0249 sec
[sql] /home/mimo/tmp/dt/darktable/src/common/image.c:675, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0245 sec
[sql] /home/mimo/tmp/dt/darktable/src/common/image.c:675, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0245 sec
[sql] /home/mimo/tmp/dt/darktable/src/common/image.c:675, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0135 sec
[sql] /home/mimo/tmp/dt/darktable/src/common/image.c:675, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0135 sec
[sql] /home/mimo/tmp/dt/darktable/src/common/image.c:675, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0170 sec
[sql] /home/mimo/tmp/dt/darktable/src/common/image.c:675, function dt_image_altered(): prepare "SELECT operation FROM main.history WHERE imgid = ?1"
[lighttable] image expose took 0,0138 sec
[mipmap_cache] thumbs fill 98,88/2048,00 MB (4,83%)
[mipmap_cache] float fill 0/4 slots (0,00%)
[mipmap_cache] full fill 1/4 slots (25,00%)
[mipmap_cache] level | near match | miss | stand-in | fetches | total rq
[mipmap_cache] thumb | 1,79% | 1,79% | -nan% | 0,00% | 100,00%
[mipmap_cache] float | -nan% | -nan% | -nan% | 0,00% | 0,00%
[mipmap_cache] full | -nan% | -nan% | -nan% | 100,00% | 0,00%
[lighttable] expose took 0,2702 sec
So it seems that the actual slow-down is caused by “expose” when skipping to next thumb, not the constant redraw. Quarter of a second may not seem like much, but when mouse moves quickly by several thumbs the highlight can take up to few seconds to catch up.
Is this something that can be optimized, or maybe influenced by some configuration? Thanks!