[Evaluate] optimize listview controls filling in TVSetup - Channel list for groups (2 Viewers)

Vasilich

Test Group
  • Team MediaPortal
  • August 30, 2009
    3,393
    1,170
    Germany, Mayence
    Russian Federation Russian Federation
    Country flag
    • Thread starter
    • Moderator
    • #21
    i was disappointed from possibilities of gentle.net - no SQL in SQL, no suffixes for operators (like SELECT DISTINCT), and no support, as further development of gentle is abandoned.

    Still, i found the possibility to write pure SQL queries when using Gentle. So this is my attempt to fix the filling of listviews for channels using dictionaries and pure SQL queries as optimal as possible. I have done it only for tv channel group list, but now it takes 2.5 seconds (instead of 80 seconds originally) for 4600 channels. I think this is an acceptable time i can live with ;)

    mm and gibman (and maybe other MP devs?), please check the patch and tell your meanings before i apply it on all other places working with channel lists.
     

    Attachments

    gibman

    Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Denmark Denmark
    Country flag
    thx for the patch :)

    you should try and move the SQL related stuff into a proper public method in the tvlibrary class.

    and try and define your generic lists as: IList or ICollection, Ienumerable, Idictionary etc. where possible (the more basic interface the better it is).

    /gibman
     

    mm1352000

    Development Group
  • Team MediaPortal
  • September 1, 2008
    21,571
    8,218
    New Zealand New Zealand
    Country flag
    Hi again Vasilich

    Any updates on this Vasilich?

    mm
     

    Vasilich

    Test Group
  • Team MediaPortal
  • August 30, 2009
    3,393
    1,170
    Germany, Mayence
    Russian Federation Russian Federation
    Country flag
    • Thread starter
    • Moderator
    • #24
    sorry for the delay.
    I am trying to rework my patch to reuse as much code as possible for all parts of TVConfig (e.g. channels, Radio channels, channel groups, manual control (there we have a combobox with all channels),...), but have been busy in real life, and wont finish it until the end of next week.

    Just a side note - it takes now for finished parts of code less than 3 seconds for 4k5 channels :)
     

    Vasilich

    Test Group
  • Team MediaPortal
  • August 30, 2009
    3,393
    1,170
    Germany, Mayence
    Russian Federation Russian Federation
    Country flag
    • Thread starter
    • Moderator
    • #26
    i know that it won't come into trunk in at least 2 weeks, but still..
    reworked version of the patch with optimizations for almost every channel list in TVSetup:
    • Tv/Radio complete channel lists and channel list groups
    • Tv/Radio channel mapping lists
    • Tv/Radio channel combining lists
    • Tv/Radio EPG channel lists
    • Combobox with all channels in Manual control
    Optimization (in my case getting e.g. "All channels" TV group content for 4k5 channels takes now less than 4 seconds instead of 80 in unpatched SetupTV) is done via rewriting of SQL queries and using dictionaries for searching in lists. Another part is the optimized filling of ListViews.
    Almost all this stuff i implemented as several functions and placed them in new file ChannelListHelper.cs

    Other changes:
    • added enumeration ChannelProviderType instead of direct numbers (i hate magic numbers in code)
    • added function to retrieve icon index for a channel from its tuningdetails (again, i hate magic numbers)
    • consolidated radio and tv code (this part contains most of spaces/linefeeds changes in the patch) for easier maintaining of it later
    • added "use for EPG only" to radio EPG channel list (similar to TV list, also see above)
    • added indication of DVB-S2 channels

    I hope that devs also take a critical look to my coding style, and if it doesn't fit to MP - then let me know ;)
     

    Attachments

    mm1352000

    Development Group
  • Team MediaPortal
  • September 1, 2008
    21,571
    8,218
    New Zealand New Zealand
    Country flag
    Hi Vasilich

    This patch is ***huge*** - that makes it quite difficult to evaluate. I've looked at parts of it and it seems okay (although there are some additional dependencies between the projects that I'm not so sure about), however it would be better if you could create separate patches for each of the changes. We'd need to do that before committing...

    mm
     

    Vasilich

    Test Group
  • Team MediaPortal
  • August 30, 2009
    3,393
    1,170
    Germany, Mayence
    Russian Federation Russian Federation
    Country flag
    • Thread starter
    • Moderator
    • #28
    i can divide this patch into 3 parts:
    1. enumeration ChannelProviderType instead of direct numbers - it will contain almost a half of the all changed files, with changes like "0" -> "ChannelProviderType.Analog"
    2. consolidated radio and tv code - it will contain mostly changes in spaces and linefeeds plus added "use for EPG only" to radio EPG channel list (similar to TV list)
    3. the rest of the patch as it is mostly reducing (or similar change) of code plus adding of new file ChannelListHepler.

    will that division be ok? Or should i divide also 3rd part into subpatches for every changed settings page (e.g. patch for channel lists, patch for channel list groups, patch for channel mappings, etc.)?
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    United Kingdom United Kingdom
    Country flag
    As for 1 just to say there is a patch lying round in team forums for this but never quite got completed (can't remember why now but was under something about adding tuning details for DVB-IP)

    Also I think ChannelProviderType is a bad name as it is not related to a channel or provider. This would be better call TuningDetailType ?
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 2)

    OP Similar threads Forum Replies Date
    splatterpop My optimized dvb epg configuration for tv server MediaPortal 1 Talk 0
    henrysinn Remote - W10 Gyro by Pepper Jobs General 8
    G Remote control suggestions? MediaPortal 1 Talk 16
    mrmojo666 [Tv Server Plugin ]Direct Show Video Control Plugin 0.0.0.1 for Hauppauge PVR cards MediaPortal 1 Plugins 0
    T TV Player Controls WMC Skin 0
    emphatic Allow remote control mapping of all plugins Improvement Suggestions 0
    S Problem with Remote Control One-for-all Streamer Newcomers Forum 6
    Rob Hexenmeister Playing with hyperlinkParameter and List Control indexes General Support 2
    mrmojo666 [Plugin]Marantz Control Plugin 0.0.0.2 MediaPortal 1 Plugins 2
    T Can Emprex 3009ARF III MCE Remote Control be used to toggle Fullscreen/Windowed mode?? Remotes 7
    N [Proposal] Make text input using remote control easier MediaPortal 2 4
    Rob Hexenmeister Current control ID General Support 10
    N [Proposal] Make text input possible with remote control in SMS style MediaPortal 2 1
    N [Finished] [MP2-789] MCE remote control Recorded TV and My Pictures buttons do not work MediaPortal 2 17
    Rob Hexenmeister [solved] Latests Media Handler - Skinning an updating window or control Fanart Handler 26
    N How to input text with the remote control General 3
    milagroso Remote control with EventGhost - I'm stuck, need help General 3
    C Manual Control doesn't work anymore inside TVServer General Support 4
    HTPCSourcer Harmony Smart Control freezes Input/Output Interfaces 3
    coolblue [solved] Double Volume Control with RC6 IR General 4
    F Blu-Ray Contextual Menu Remote Key/Keyboard Watch / Listen Media 5
    Top Bottom