Optimization of inherited compared