Alas, very long lines are also slow in Tk text widgets, and your example above has one enormous line. Tk uses a b-tree to represent the contents of the widget, but the leaves of the b-tree are lines (everything between two newline characters), so Tk has to do linear searches through lines to find anything. It probably would have made sense to make the leaves of the tree smaller units than lines and perhaps some day we'll do this,