mpl-1.2.1: Speedup code by removing .startswith() calls and some for loops

[re-sending with also the 3rd patch file, sorry]

  I am drawing some barcharts and scatter plot and the speed for rendering is awful once you have
100 000 of dots. I ran python profiler which lead me to .startswith() calls and some for loops
which append do a list repeatedly. This parts could be still sped up I think but a first attempt
is here:


real 23m17.764s
user 13m25.880s
sys 3m37.180s


real 6m59.831s
user 5m18.000s
sys 1m40.360s

The patches are simple and because I see elsewhere in the code list expansions I do not see any
problems with backwards compatibility (new new python language features are required).

Hope this helps,
Martin (445 Bytes) (1.03 KB) (1.68 KB)