Random Slowdown in GUI

Blitz3D Forums/Blitz3D Programming/Random Slowdown in GUI

Stevie G(Posted 2009) [#1]
In my current game, I've found that, randomly and infrequently, my gui updates seem to take 2 x, 3 x or 4 x longer than normal.

The gui is my own, not a 3rd party library. I have pinpointed the issue to an update button function where I do the following:

* Clear the existing surface for the main mesh
* Loop through all required characters
* Find and copy a child mesh for each character ( all child meshes are attached to a root pivot and accessed by name)
* Copymesh the child mesh
* Addmesh the Copy to the main mesh
* Freeentity the copy

This function updates the text every 4 frames for animation purposes and generally runs smooth as a baby's arse.

I also never have any slowdown in game - only when the menu's are being displayed which suggests no issues with the gfx card.

I have set timers in every part of the menu update and there is no slowdown during renderworld(), only in this function.

I have no applications running in the background (ran it alongside Task Manager during the slowdowns) and even then I have a small delay before renderworld which results in BB only using 30% CPU. There are also no memory leaks.

I originally thought this may be a mesh cacheing issue but I would expect to see intermittant slowdowns. Once the slowdown happens, it does not speed up until I come out of the menu's, enter the game and return back to the menu's.

I've spent the last week or so trying to figure out what's going with debug information everywhere and I'm at a loss. I cannot seem to re-create the circumstances which make it happen - they are completely random.

Does anyone have any idea's?

Cheers
Stevie


_PJ_(Posted 2009) [#2]
Are any of these animated meshes? Just wondering if it may be related to the 1.03 update???

I guess there could be a bottleneck as it finds the 'valid' children via name, does it make any difference how many of these there are?

Same, perhaps with the CopyMesh, are th meshes complex at all, with lots of tri's? Still, it shouldn't be THAT hard for any computer made after 1960 >.>

maybe there's a nasty little loop or something within the update section that you've missed?

That's about it for now, if I have any sudden flashes of inspiration, I'll let you know...


Stevie G(Posted 2009) [#3]
No animated meshes - polygons in each mesh are < 200. Nothing dodgy in the function - it simple does what it says on the tin and 99% works just fine.

All ideas, however daft, are most welcome!


Jiffy(Posted 2009) [#4]
Meshes too close to the camera, or too big can cause slowdown on some gfx cards. Without more details, I'd say 'Update your drivers' and pretend that will help.

But you're actually likely to have a memory leak- I avoid freeing things I can keep or ignore till program end.


Stevie G(Posted 2009) [#5]
@ Jiffy, drivers aren't the issue I'm sure as, like I said, the rendering in game is very fast. This is an intermittant problem, if it related to the meshes being too close to the camera, which they aren't, then I'd always see the slowdown. I also have no memory leak.

Anyone?


RifRaf(Posted 2009) [#6]
Random and infrequent suggests an outside influence into the actual routine, or bad data that is only introduced under certain conditions..for example the letter Q has bad geometry , or some sort of memory leak

every 4 frames?..whats your locked logic fps ?

Do you have anything else running that is perhaps accessing the 3D card.

You are creating and destroying alot of mesh data over time.
Are you using clearworld between levels or maps ect ?