Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove boost from GUIFontCache #8996

Merged
merged 1 commit into from
Feb 1, 2016
Merged

Conversation

FernetMenta
Copy link
Contributor

see title
superseds #7495

@FernetMenta FernetMenta added Type: Cleanup non-breaking change which removes non-working or unmaintained functionality v17 Krypton labels Jan 30, 2016

EntryList m_list;
CGUIFontCache<Position, Value> *m_parent;
std::map<size_t, Value*> test;

This comment was marked as spam.

This comment was marked as spam.

@FernetMenta
Copy link
Contributor Author

updated. this is basically the same behaviour without the boost clutter
@popcornmix you reported issues on #7495 could you test this on Pi please?

@Paxxi
Copy link
Member

Paxxi commented Jan 31, 2016

Will this have the same performance chracteristics as the multi_index solution? Not sure that it matters in real life use though. I'll close mine so we can focus work here.

@FernetMenta
Copy link
Contributor Author

I can't think of any reason why it should perform worse. Maybe it is even better because index of age is simplified. Writing this I think I access this index from the wrong end :)

typedef typename EntryList::template index<Hash>::type::iterator EntryHashIterator;
struct EntryList
{
typedef std::multimap<size_t, CGUIFontCacheEntry<Position, Value>*> HashMap;

This comment was marked as spam.

This comment was marked as spam.

@Paxxi
Copy link
Member

Paxxi commented Jan 31, 2016

hehe :) No real objections to the solution from my side but there's a few minors.

  1. method names should follow naming standard with uppercase first letter
  2. use std::make_pair instead of pair constructor(could make it a bit more readable)

Interested to see the testing by @popcornmix and @MilhouseVH how it performs.

@FernetMenta
Copy link
Contributor Author

  1. use std::make_pair instead of pair constructor(could make it a bit more readable)

I used value_type as suggested by the docs. This make the code shorter because you don't need the template stuff

@FernetMenta
Copy link
Contributor Author

lets see how it compiles on the various platforms
jenkins build this please

@popcornmix
Copy link
Member

This causes a performance regression.
On Pi2 with RSS enabled on confluence main menu with VIDEOS highlighted, I initially get ~47fps with both the original and with this PR.
However as time elapses the fps goes down with this PR. After 30 minutes I'm at 25fps. This slow down doesn't occur with original code.
I suspect cache entries are not being released correctly making cache lookups slower with time.

{
delete &m_key.m_colors;
delete &m_key.m_text;

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@FernetMenta
Copy link
Contributor Author

@popcornmix can you log the size of HashMap every couple of seconds?

@afedchin
Copy link
Member

@FernetMenta HashMap size isn't changed, but agemap is decreased gradually every few minutes

@FernetMenta
Copy link
Contributor Author

@popcornmix @afedchin you were right. there was an issue with AgeMap.erase was called with wrong iterator

@Paxxi
Copy link
Member

Paxxi commented Jan 31, 2016

I tested my theory and it works fine on gcc which is picky about these things.
Paxxi/xbmc@ba3862b

@popcornmix
Copy link
Member

With "squash me" commit it looks okay. Still ~47fps after 15 minutes.
Might be worth waiting for feedback from tonight's Milhouse build as this code is pretty critical for performance.

@afedchin
Copy link
Member

@FernetMenta seems now it works as expected. both sizes of maps are identical and constant

@FernetMenta
Copy link
Contributor Author

jenkins build this please

@Paxxi
Copy link
Member

Paxxi commented Jan 31, 2016

@FernetMenta reverted the make_pair changes Paxxi/xbmc@d76d467

@FernetMenta
Copy link
Contributor Author

jenkins build this please

@FernetMenta
Copy link
Contributor Author

@popcornmix @MilhouseVH did you hear any issues related to this?

@MilhouseVH
Copy link
Contributor

None reported so far, but it's only been 12 hours (though 82 installations).

@popcornmix
Copy link
Member

I'm okay with this being merged. We'll let you know if any issues show up down the line, but I think this is probably fine.

FernetMenta added a commit that referenced this pull request Feb 1, 2016
remove boost from GUIFontCache
@FernetMenta FernetMenta merged commit 9c32dff into xbmc:master Feb 1, 2016
@FernetMenta FernetMenta deleted the guifont branch February 1, 2016 10:21
@MilhouseVH
Copy link
Contributor

I'm seeing evidence of text/font "glitching" which is a result of this PR, but only with OpenELEC RPi/RPi2 builds and not OpenELEC x86 builds.

I also do not see the glitching with Kodi on Ubuntu x86, so it may be GL/GLES related.

In my RPi test builds the problem first appears in build #0131, which is when I introduced this PR.

In a test build I have reverted this PR on RPi/RPi2 (and also #9021, restoring Boost) and the glitching problem went away, so it's definitely a result of this PR.

The problem only seems to affect the debug overlay text, I haven't seen issues with other non-debug GUI text, but it may be a prelude to further problems down the line.

See the following frame grabs from this video (Dropbox, 62MB):

  1. Shadow of middle line overlays top line:
    screen1
  2. Shadow of bottom line is much lower than it should be:
    screen2
  3. Foreground text (without shadow) from middle line overlays itself:
    screen3

To reproduce:

  1. Configure Dim screensaver, 20% opacity (not sure opacity matters, but it's what I'm using), timeout doesn't matter. The Black screensaver can also be used to reproduce this issue
  2. Enable debugging with debug overlay
  3. Click "Preview" (or wait) for Dim/Black screensaver to activate

Result:

  1. Debug overlay text starts to visibly flicker and glitch as foreground and shadow text is displayed at the wrong coordinates

Glitching of the debug overlay text continues after the screensaver is deactivated.

Using a screensaver such as Shader Toy does NOT cause this problem. I haven't tested any other screensavers.

Edit: Fixed by #9065

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Cleanup non-breaking change which removes non-working or unmaintained functionality v17 Krypton
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants