Opened 10 years ago

Closed 10 years ago

#7855 closed patch (fixed)

Improve image loading performance

Reported by: Jim Stichnoth <stichnot@…> Owned by: stuartm
Priority: minor Milestone: 0.23
Component: MythTV - General Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

This patch gives a small performance boost in drawing screens, especially the Watch Recordings screen, leading to slightly improved responsiveness.

The issue is that certain images may be loaded dozens if not hundreds of times, and even if the image is already in the cache, a stat system call is still performed to see if the original file has changed. These system calls can add up, especially on network file systems.

The new code relaxes the check on the original file so that the check isn't repeated if it was already done within the past 5 seconds.

Attachments (1)

relax_image_cache.patch (1.0 KB) - added by Jim Stichnoth <stichnot@…> 10 years ago.

Download all attachments as: .zip

Change History (3)

Changed 10 years ago by Jim Stichnoth <stichnot@…>

Attachment: relax_image_cache.patch added

comment:1 Changed 10 years ago by Stuart Auchterlonie

Milestone: unknown0.23
Owner: changed from Isaac Richards to stuartm
Status: newassigned
Version: unknownhead

comment:2 Changed 10 years ago by stuartm

Resolution: fixed
Status: assignedclosed

(In [23245]) Don't check the modification times on files which have only recently been added to the cache (last 5 seconds). Stating files is expensive and this should speed things up a little in certain scenarios. The way this is currently implemented means that the cache timestamp may be out by as much as 5 seconds and I've not considered the possible ramifications of that yet, but they should be minor. Patch thanks to Jim Stichnoth. Closes #7855

Note: See TracTickets for help on using tickets.