When we compare we are trying to gain a sense of, "How do I look compared to how you look? How am I performing compared to your performance? Is my house bigger or smaller than yours? Is my marriage as good or better than yours? Are my children better at "looking right" compared to yours?" The list of potential comparisons is endless.
In John 21:15-17, Jesus questions Peter three times concerning Peter's love for Him. Peter emphatically asserts his love for the Savior. This would have been a great place to end the chapter because Peter's commitment and devotion are powerful and admirable, but the chapter doesn't end.
In John 21:20-21, Peter shifts from walking in the Spirit to walking in his flesh, "Peter, turning around, saw the disciple who Jesus loved following them; the one who also had leaned back on (Jesus') bosom at the last supper (referring to the Apostle John). Peter says in verse 21, "Lord, and what about this man (pointing to John)?"
Comparing is a human phenomenon. God doesn't compare and He doesn't want us to compare either. In John 21:22, Jesus rebukes Peter, "If I want him (John) to remain until I come, what is that to you? You follow Me!" Jesus directs Peter to get his eyes off John and maintain his focus and will on his personal obedience to Jesus.
Are you currently comparing something in your life with something in the life of another? Comparing fosters internal pride and gloating or it creates a deep sense of shame and feeling less than. Don't compare. Do what Jesus commanded Peter, keep your eyes on yourself and your personal walk with the Lord.