CPU profiling of demo.py