While compare-ing, sort-ing and keysort-ing, the actual term representation may be improved:
-
shorten refchains
-
make ==-identical subterms refer to each other
All of this makes sense in particular if there is no choicepoint in between. Otherwise some trailing would be necessary.
#3211 would profit from this.