equalsIgnoreCase can be much faster. For example, consider two lines starting with the same 10,000 characters, but one of them has an extra character at the end. equalsIgnoreCase may return immediately; compareToIgnoreCase must iterate to the end of the line to see the difference.
But in general, I would go with what expresses your intention better. This works well for performance: assuming I'm right in saying that equalsIgnoreCase is at least as fast as compareToIgnoreCase , it means you should use this where you can - if you need the actual order, you should use compareToIgnoreCase anyway.
Jon skeet
source share