title: TKinter text box "insert" optimization
body: <p>2 issues :</p>
  <ul>
  <li>Main issue - deleting and inserting instead <strong>tagged</strong> lines (&gt; 100K lines)
  How can i optimize speed ?
  (I am deleting specific line, then i insert the tagged line at same place)</li>
  <li>inserting ~3 million lines (single string, multi line) - takes ~1 second -
  I can live with that, but if there is a better way, would like to hear.</li>
  </ul>
  <p>I am using Cython, improved performance a lot for string manipulations before textbox insertion.
  Can i use Cython to insert to Tkinter textbox faster ? (Probably not)</p>
  <p>Would appreciate a professional that took the time to investigate this type of optimization.</p>
  <p><strong>Added Code:</strong></p>
  <p>#Inserting all lines, quick when doing in a single call</p>
  <p>self.textWindow.insert(END, buffer)</p>
  <p>Putting tagged lines instead of current line:</p>
  <p>for Lines in buffer:  # Around 3 millions iterations</p>
  <pre><code>self.textWindow.delete(f'{Lines[i]}.0', f'{Lines[i]}.end+1c')
  self.textWindow.insert(f'{Lines[i]}.0', Lines[i], tag[i])
  </code></pre>
  <p>is there a direct API i can put all tag lines in a single call ? (Even in Tkl/C) ?</p>
  <p>Tried with:</p>
  <pre><code>self.textWindow.tag_add(tag[i], f'{Lines[i]}.0', f'{Lines[i]}.end')
  </code></pre>
  <p>No color changed in this way **</p>
  <p>Even if this works, it will not be fast enough, that's why i want to find a more creative way to optimize time to execute.</p>
  <p>Regards,
  Amit</p>