[Approved] Fix string functions (skin) getting re-evaluated every render pass (1 Viewer)

armandp

Retired Team Member
  • Premium Supporter
  • April 6, 2008
    990
    620
    Zoetermeer
    Home Country
    Netherlands Netherlands
    If a skinner uses a string function in the skin the condition will get re-evaluated every render pass causing high cpu usage. I created a patch that will cache the result of the condition untill one of the input properties changes. This will severely cut down the cpu% for skins using a lot of string functions.

    edit: ok i corrected a bug where it didn't account for the prefix "!" (inverting the result of the condition). New patch is attached called v2 i'm leaving the old patch as a reference.
     

    Attachments

    • Patch_CacheMultiInfoBoolStringFunctionResults_r25130.patch
      30.8 KB
    • Patch_CacheMultiInfoBoolStringFunctionResults_v2_r25130.patch
      30.8 KB

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,755
    7,200
    Sydney
    Home Country
    Australia Australia
    Tested and confirmed that CPU use drops from 99% to 40% on one core when patch is applied.
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,755
    7,200
    Sydney
    Home Country
    Australia Australia
    Best way to reproduce this, is as follows:

    1. Load Up StreamedMP Skin (v1.0) in windowed Mode
    2. Enter MovingPictures, and sit Idle on facade
    3. Bring up TaskManager
    4. Bring MediaPortal into focus

    Result: 100% cpu use on a single core. if you have a quad core this would be represented as 25% but you can see the core use in the Performance tab.
     

    armandp

    Retired Team Member
  • Premium Supporter
  • April 6, 2008
    990
    620
    Zoetermeer
    Home Country
    Netherlands Netherlands
    • Thread starter
    • Moderator
    • #4
    note to code style commission:
    i just noticed the patch has some new methods using the "java style" braces on same line (because this is my default from other projects)
    I have overlooked this when creating the patch. Perhaps the person implementing the patch at some stage can correct this or if you require a new patch let me know.
     

    armandp

    Retired Team Member
  • Premium Supporter
  • April 6, 2008
    990
    620
    Zoetermeer
    Home Country
    Netherlands Netherlands
    • Thread starter
    • Moderator
    • #5
    ok i will update this patch as it ignores the negating "!" in front of the condition.

    edit: updated see, v2
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,755
    7,200
    Sydney
    Home Country
    Australia Australia
    Tested new patch, and fixes conditions that are negated.
     

    chemelli

    Retired Team Member
  • Premium Supporter
  • September 28, 2006
    6,159
    2,264
    50
    Milano, Italy
    Home Country
    Italy Italy
    can you be so kind and fix also "+" handling in skinengine, if not too risky ?

    I replaced it with "plus" in latest MediaInfoWrapper commit because of the bug.

    Simone
     

    armandp

    Retired Team Member
  • Premium Supporter
  • April 6, 2008
    990
    620
    Zoetermeer
    Home Country
    Netherlands Netherlands
    • Thread starter
    • Moderator
    • #8
    chemelli: just to be clear - that's another issue right? or is it something that my patch doesn't account for?
     

    chemelli

    Retired Team Member
  • Premium Supporter
  • September 28, 2006
    6,159
    2,264
    50
    Milano, Italy
    Home Country
    Italy Italy
    @chemelli: just to be clear - that's another issue right? or is it something that my patch doesn't account for?

    yup another, different, separate issue.

    Simone
     

    Users who are viewing this thread

    Top Bottom