Profile nested functions