Re: Code profiling




Steve Alan Waring wrote:
Hi Jeff,

It's always nice to see when 90% of the execution time is found to be
in one location (isn't that always the case?). Regardless, FPS is up to
1000. This is incredibly good news, and I huge worry is now gone. :-)

Can I ask what the problem was?

It was actually a stupid mistake on my part that is a decent
performance hic-up in Direct3D period (state changes), but the same
code in C++ isn't as big a performance hit as it was in Dolphin.
Basically, at the start of every frame I was resetting all the render
states. This actually has me concerned that the COM wrappers in Dolphin
will be (eventually) a big performance sync, and that I'll have to
buffer as much as I can. That change alone took the FPS up into the
4,000 region on my workstation at work (1K at home).

Also, how are you driving your renderLoop ... are you using a process
or WM_TIMER or ?

Right now, I just create my own "main" loop. It looks something like
this:

GameEngine>>run
[view isOpen] whileTrue:
[self postRedisplay.
SessionManager inputState pumpMessages.
framecount := framecount + 1].

Probably not the way I'll do it at the end of the day, but it's simple
to test and should give the best performance. Funny enough, after the
above performance bottleneck was removed, the second biggest is
"SessionManager inputState". Making that a local variable increases
performance by another 100 or so FPS (that's a BIG deal - what could
that possibly be doing that's so intensive?). Running with the profiler
revealed several such instances (example: Keyboard default).

Jeff M.

.