Small and usefull benching function with memory information to bench structures/class on the fly
Allow to test destuctors & find mem leaks.
Rem : the webkit gc() method is requiered to get memory deltas;
It need be activated from the command line using the following switchs :
%chrome path/exec% --enable-precise-memory-info --js-flags="--expose-gc"
or for older chrome version :
%chrome path/exec% --enable-memory-info --js-flags="--expose-gc"
Sample Example :
Samples 4 : 267ms: mem delta : 7.01Mo;
After collect : 2.67Mo
61.911554921540656 % cleaned
Create & destroy the tested object in the bench function, in the right context; Then see if garbage collect clean them well.