Dynamic Memory Allocation Performance

 

 

 

Performance Summary for each solution is presented below. 

 

 Performance Summary

 Number of Requests: 5000000
—————————
         ANSI C       C++      Collapse    Pool Based

real    0m2.808s   0m4.532s    0m0.292s        0m0.490s

user    0m2.523s   0m4.376s    0m0.160s        0m0.460s

sys     0m0.220s   0m0.110s    0m0.040s        0m0.050s

Number of Requests: 10000
————————–
         ANSI C       C++      Collapse    Pool Based

real    0m0.043s   0m0.055s    0m0.039s        0m0.041s

user    0m0.030s   0m0.040s    0m0.030s        0m0.030s

sys     0m0.020s   0m0.020s    0m0.020s        0m0.030s

Number of Requests: 100
————————
         ANSI C       C++     Collapse    Pool Based

real    0m0.037s   0m0.042s    0m0.035s        0m0.033s

user    0m0.030s   0m0.020s    0m0.030s        0m0.020s

sys     0m0.020s   0m0.030s    0m0.020s        0m0.030s

 

As it is evident, algorithm selection criteria depends on requirements but for high performance system, some kind of special provision is necessary.  As evident here, in a big data management system, pool based implementation is the winner because of ease of use and performance gain. In smaller systems, probably using simple mechanism is good enough.

Acknowldgement – Some of the information is compiled from following sites. 


Disclaimer, the evil necessity: Posted views are of author only and this website is no way responsible for any damages caused by usage of this information.

Leave a Reply

Your email address will not be published. Required fields are marked *