I've made a small tool that parses a chunk of text, does some simple processing (retrieves values from a dictionary, a few regex, etc.) and then spits the results.
In order to make easier to read the results, I made two graphic ports, one with tkInter and other with wxPython, so the output is nicely displayed in a Text Area with some words having different colours.
The tkInter implementation uses Tkinter.Text
object and to apply the colours to the words uses tags (configured with the method Tkinter.Text.tag_config
and passing them to Tkinter.Text.insert
), and the measured while outputting about 400 different coloured words is < 0.02s.
The wxPython implementation uses wx.richtext.RichTextCtrl
and to apply the colours to the words uses wx.richtext.RichTextCtrl.BeginTextColour
and then wx.richtext.RichTextCtrl.AppendText
; the performance is ridiculous, it takes abut 1.4s to do the same job that only took 0.02s to the tkInter port.
Is this an intrinsic problem of the RichTextCtrl widget, the wxPython bindings, or there is some way to speed it up?
Thanks!