Used gpf.defer to limit call stack size
Added time measurement
Test fix