Re: Programming Optimization




Antoine wrote:
Gamer_2k4 wrote:
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.

Right, i think.

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.

.



Relevant Pages

  • Re: CE6.0 Driver Pointer Marshalling - passing pointers out only?
    ... This is an array of pointers to buffers that get set up ... the driver allocates the buffers (via an internal allocation ... routine from its own block of reserved memory). ... So I can map ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Programming Optimization
    ... then that can't be the hangup. ... nonobvious and you'll be best to use profiling to find it. ... the monster constructer includes a pointer to a map. ... Someone with a better memory will be able to help. ...
    (rec.games.roguelike.development)
  • Re: Still confused why working set larger than virtual memory
    ... With the SysInternals Process Explorer the column is called Working Set. ... What you removed is exactly the "smart trick" to have memory "accessible", ... as you map views you never unmap. ... I attach my test source which I used for my file mapping measurements. ...
    (microsoft.public.vc.language)
  • [PATCH] x86: make e820.c to have common functions
    ... * replaces the original e820 map with a new one, ... * will have given us a memory map that we can use to properly ... struct e820entry map; ... extern void setup_memory_map; ...
    (Linux-Kernel)
  • Re: Help me pick which is best
    ... That's why the expandable memory seemed so attractive but then the battery is rechargeable, which I guess may not be a huge problem, but who knows. ... If you wanted to change from street and highway mapping to topo mapping on the fly, you might need to have access to a computer to upload the new mapping. ... In use I would have to change from one regional map to the next as I traveled, it takes about 15 regional map files to cover the entire U.S. with DirectRoute or Topo 3D. ... The process of making the regional map files is a little bit technical or arcane because, while Magellan says that map files can only be 16mb, there many, many, Meridian users that are making and using 64mb map files. ...
    (sci.geo.satellite-nav)