n8tz / v8mem-bench

Small but usefull benching function with memory information (use the webkit gc() function that need to be activated on the command line)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mem benchTools

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

How to use ?

Create & destroy the tested object in the bench function, in the right context; Then see if garbage collect clean them well.

About

Small but usefull benching function with memory information (use the webkit gc() function that need to be activated on the command line)

License:MIT License


Languages

Language:HTML 57.2%Language:JavaScript 42.8%