Opened 12 years ago
Closed 12 years ago
Last modified 12 years ago
#11053 closed Patch - Feature (fixed)
let EITScanner cache negative lookups
Reported by: | Owned by: | Karl Egly | |
---|---|---|---|
Priority: | minor | Milestone: | 0.27 |
Component: | MythTV - EIT | Version: | Master Head |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
inspired by Göran Uddeborg
http://lists.mythtv.org/pipermail/mythtv-dev/2012-August/072902.html
--- libs/libmythtv/eithelper.cpp.orig 2012-08-27 21:27:14.005909017 +0200 +++ libs/libmythtv/eithelper.cpp 2012-08-27 21:28:10.981876447 +0200 @@ -648,8 +648,7 @@ return max(*it, 0); uint chanid = get_chan_id_from_db(sourceid, atsc_major, atsc_minor); - if (chanid) - srv_to_chanid[key] = chanid; + srv_to_chanid[key] = chanid; return chanid; } @@ -667,8 +666,7 @@ return max(*it, 0); uint chanid = get_chan_id_from_db(sourceid, serviceid, networkid, tsid); - if (chanid) - srv_to_chanid[key] = chanid; + srv_to_chanid[key] = chanid; return chanid; }
Negative hits are relevant for all channels that have either been deleted or useonairguide disabled though there is some transmitted guide. If a multiplex has no channel at all with useonairguide enabled the whole multiplex is skipped.
The patch is untested as of now as I'm running a modified version of the EITScanner at the moment.
Attachments (1)
Change History (5)
Changed 12 years ago by
Attachment: | mythtv_11053_cache_all_channel_id_results.patch added |
---|
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Another thing, there is something strange with the EITHelper::GetChanID() functions.
1) The map 'srv_to_chanid' stores channel ID as a signed integer, but get_chan_id_from_db() returns channel ID an unsigned integer. Should the channel ID be signed or unsigned?
2) if the channel ID is in cache, the the channel ID is clamped to all positive numbers and 0 (return std::max(chanid, 0)), but if it isn't in the cache, the channel Id is just returned (return chanid)
comment:3 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 Changed 12 years ago by
Milestone: | unknown → 0.27 |
---|---|
Owner: | changed from Stuart Auchterlonie to Karl Egly |
great idea, I have improved your patch slightly for DVB, so fixup isn't calculated if channel lookup is negative.
It gives a slight measurable improvement in CPU usage for 'mythtvbackend' and a noticeable improvement in CPU usage when the EIT scanner is running in the background.
I am running this on a 700Mhz ARM system, so the improvement may be harder to notice on more powerful systems.