Note: I haven't actually read beyond your first sentence in your last response, because I didn't really get the impression that you were trying to be particularly helpful - so to prove my good will, I have done what you asked me to do, and adapted one of the Canvas snippets to randomly draw 3000-6000 lines to a GUI dialog.
http://wiki.flightgear.org/Howto:Canvas ... nchmarking
I am hopeful that we can adapt this to turn this into a stress-test/benchmark to see if, what and how this can be optimized (and yes, I am willing to also look at the C++ side of this).
For starters, it would be great if you could take a look and adapt this so that this makes sense in terms of the approach/use-case you have in mind (e.g. numbers, primitives added to the scene, and workload created by this).
Next, my suggestion would be that you provide your own test function that implements the logic you are currently using - which would tell us if there are any low-hanging fruits or not, and if you are already using the fastest method.