hendu wrote:Don't do that. You should remove all memory allocation from hot paths.
he posted a virus? I'll not execute his code but at least explain why. (personally don't know anything about hot paths.)
If you are going to measure memory allocations speed you likely need microseconds timers, and anyway you can't profile memory like that.
A good allocator performance is measured in real cases (exactly where needed, since every allocator behaves differently)
Just to say, when I replace standard "new" in my game with specialized allocators I reduce allocation time from 2 to 30 times (this is not going to affect in significative manner framerate since there are not so many allocations every frame in my game so I left "new" not overloaded since is assumed to be more stable than custom allocators.).
Probably keeping a code like your will increase throughput of allocations but that's not a real case of allocation
so u should not assume your code as valid testing case (there are complex frameworks for this kind of tests just search on google/wikipedia. lot of material about memory
profiling).
and anyway.. 4 seconds are referred to wich CPU?, wich hardware you have? memory is affected by your internal PC architecture (bus speed, RAM speed, in some cases even HD speed since if your application is going to sleep for a while, Operative system is likely to temporary transfer your app on HD for later restore to free extra RAM for other processes). without knowing wich hardware you have, those numbers are mostly useless.
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me