Improvement on my last change for reducing the formatted text caching: chopped it out altogether. I ran some profiling to see how much time on the psp it took to process the formatting on the description text (ie word wrapping it into several lines to fit on a card), and it ends up taking an average of 0.14 ms per card. For context, 60 fps is 16 ms. So clearly the formatting time is not the bottleneck here, and we gain no real performance caching the text, but lose memory due to pooling. So I cut it out entirely of the base class and we format on the fly during renders.
I also profiled this after the fact, as we have an open bug on poor drawing performance on psp when in text mode - it turns out that in the AlternateRender() function, my numbers look like this: 10.2 seconds were spent in JBLFont::DrawString(); 0.5 seconds were spent in my new helper FormatText() call, so we know where the perf hit is now. I compared before & after on the psp with this mod, and the difference really isn't perceptible. (It's still juddery, but no worse than before.) I'll look at the DrawString() call next to see if we can make it any faster, although at first glance it looks like a pain.
This commit is contained in:
@@ -475,7 +475,16 @@ void GameStateMenu::Update(float dt)
|
||||
}
|
||||
if (primitivesLoadCounter < (int) (primitives.size()))
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
int startTime = JGEGetTime();
|
||||
#endif
|
||||
MTGCollection()->load(primitives[primitivesLoadCounter].c_str());
|
||||
#if _DEBUG
|
||||
int endTime = JGEGetTime();
|
||||
float elapsedTime = (endTime - startTime);
|
||||
DebugTrace("Time elapsed while loading " << primitives[primitivesLoadCounter] << " : " << elapsedTime << " ms");
|
||||
#endif
|
||||
|
||||
primitivesLoadCounter++;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user