add statistics and performance analysis