New method commit_count
Adding memoization for method