[ODE] SIGSEGV in dSolveLCP() at ode/src/lcp.cpp:1137

Nguyen Binh ngbinh at glassegg.com
Fri Feb 13 14:02:15 MST 2004


Hi ,

   The problem is vanilla malloc() /free() is incredibly slow compare
   to alloca()(somewhat about 1000 times).

   So if you try to implement a new mem alloc in ODE, I suggest not to
   use vanilla malloc(), free() but to :
       1) Allocate a big chunk() of memory initially
       2) Implement new malloc() and free() based on that chunks.

       These can be done easily cos there are many such things around.

   FYI here is test results of many mem allocation types:
   (Tests used Bench++ package)

   Start test results
---------------------------------------------------------------------
Test Name:   D000001                         Class Name:  Allocation
CPU Time:         530  nanoseconds           plus or minus       26.5
Wall/CPU:        1.02  ratio.                Iteration Count:  26214400
Test Description:
 Dynamic array allocation, use and deallocation time measurement
 Dynamic array of 1000 integers
 get space on heap using malloc() and use it in a procedure on each call



Test Name:   D000002                         Class Name:  Allocation
CPU Time:        1.38  microseconds          plus or minus     0.0691
Wall/CPU:        1.03  ratio.                Iteration Count:  26214400
Test Description:
 Dynamic array allocation, initialization, use and deallocation time measurement
 Dynamic array of 1000 integers
 get space on heap using malloc() and use it in a procedure on each call



Test Name:   D000003                         Class Name:  Allocation
CPU Time:         540  nanoseconds           plus or minus       27.0
Wall/CPU:        1.03  ratio.                Iteration Count:  26214400
Test Description:
 Dynamic array allocation, use and deallocation time measurement
 Dynamic array of 1000 integers
 get space on heap using NEW and use it in a procedure on each call



Test Name:   D000004                         Class Name:  Allocation
CPU Time:        1.40  microseconds          plus or minus     0.0700
Wall/CPU:        1.02  ratio.                Iteration Count:  26214400
Test Description:
 Dynamic array allocation, initialization, use and deallocation time measurement
 Dynamic array of 1000 integers
 get space on heap using NEW and use it in a procedure on each call



Test Name:   D000005                         Class Name:  Allocation
CPU Time:        12.0  nanoseconds           plus or minus      0.600
Wall/CPU:        1.02  ratio.                Iteration Count:  419430400
Test Description:
 Dynamic array allocation, use and deallocation time measurement
 Dynamic array of 1000 integers
 get space on stack using alloca and use it in a procedure on each call



Test Name:   D000006                         Class Name:  Allocation
CPU Time:        2.76  microseconds          plus or minus      0.138
Wall/CPU:        1.02  ratio.                Iteration Count:  6553600
Test Description:
 Dynamic array allocation, initialization, use and deallocation time measurement
 Dynamic array of 1000 integers
 get space on stack using alloca and use it in a procedure on each call
---------------------------------------------------------------------
   END test results


-- 
Best regards,

---------------------------------------------------------------------
   Nguyen Binh
   Software Engineer
   Glass Egg Digital Media
   
   E.Town Building  
   7th Floor, 364 CongHoa Street
   Tan Binh District,
   HoChiMinh City,
   VietNam,

   Phone : +84 8 8109018
   Fax   : +84 8 8109013

     www.glassegg.com
---------------------------------------------------------------------



More information about the ODE mailing list