From: Manuel Martín <mmartin@ce...> - 2010-07-09 09:57:10
A couple of ideas:
- Break your function into small sub-functions and use gprof to see
timings on each sub-function. Do this on Linux and MinGw and compare them.
- FWIK malloc is a expensive operation. Perhaps using it out of any loop
and reserving more memory than expected, is memory-expensive but faster.
A note on your code: watch out for returning without freeing memory, you
have several "return -1" before your "clean up" code.
From: Roger Pack <rogerdpack2@gm...> - 2010-07-13 00:01:51
> - FWIK malloc is a expensive operation. Perhaps using it out of any loop
> and reserving more memory than expected, is memory-expensive but faster.
For me, I discovered that using realloc on windows was *terribly* slow
compared to windows. So you may need to find tune your code for the
dynamics of windows. or use a different allocator (I remember hearing
tcmalloc works on windows...but have never used it).
Get latest updates about Open Source Projects, Conferences and News.