Marko Lekić explains how he used to solve a performance problem in one of his long running Laravel console commands.

The command worked, but very slowly. We left it working like that for some time until we finished critical stuff in the system and had time to go back and refactor some slow running code.

We ran the command with and saw some interesting information when we ordered functions by percentage of exclusive time.