tr: improve speed slightly