Name the feeling without accusing
If you feel you're being compared, say so directly but without aggression: 'When you mention your ex in that context, I end up feeling like I'm being measured against them — is that what's happening?' Opening the question directly is far more productive than silently stewing or passive-aggressing.