Splitting pull request #45: background profiling code