Python cProfile results: two numbers for ncalls Python cProfile results: two numbers for ncalls python python

Python cProfile results: two numbers for ncalls


The smaller number is the number of 'primitive' or non-recursive calls. The larger number is the total number of invocations, including recursive calls. Since deepcopy is implemented recursively, it means that you called deepcopy directly 1724 times, but that it ended up calling itself ~383k times to copy sub-objects.