Re: Programming Optimization
- From: "Corremn" <corremn@xxxxxxxxxxx>
- Date: 10 Jul 2006 20:29:51 -0700
Antoine wrote:
Gamer_2k4 wrote:Right, i think.
If there are now no large arrays created when a monster is created,
then that can't be the hangup. In that case the answer is now
nonobvious and you'll be best to use profiling to find it.
Well, ok...
Btw, the monster constructer includes a pointer to a map. The map
class has a 100 x 400 array of map tiles. But if I'm passing a
reference to a pre-existing map, or if i'm using NULL as the parameter,
no memory should be allocated, right?
Right in theory, but I haven't coded C++ for long enough that I'm not
sure, looking at your code, whether it is actually having the effect
you want. I have a vague feeling that you should be declaring a **tile,
or something like that, rather than a *tile[x][y], but can't really
remember. Someone with a better memory will be able to help.
I assume you removed tile * worldSec[300][1200] from your code?
This would allocates a large space for an array of tile pointers.
Still I would of thought that allocating memory would not be such a
noticable hangup.
What line of code is this happening, where you create an moster object.
I.e monster *new_monster = new monster (...); or somewhere else. Are
you traversing through any large arrays when you create you monster.
.
- References:
- Programming Optimization
- From: Gamer_2k4
- Re: Programming Optimization
- From: Sherm Pendley
- Re: Programming Optimization
- From: Gamer_2k4
- Re: Programming Optimization
- From: Antoine
- Re: Programming Optimization
- From: Gamer_2k4
- Re: Programming Optimization
- From: Antoine
- Re: Programming Optimization
- From: Gamer_2k4
- Re: Programming Optimization
- From: Antoine
- Re: Programming Optimization
- From: Gamer_2k4
- Re: Programming Optimization
- From: Antoine
- Programming Optimization
- Prev by Date: Re: Programming Optimization
- Next by Date: Re: Programming Optimization
- Previous by thread: Re: Programming Optimization
- Next by thread: Re: Programming Optimization
- Index(es):
Relevant Pages
|