#2936 canvas create line slow for pure lists of double coordinates

obsolete: 8.5.10
27. Objects (3)
Max Haider

In our application, we noticed that "canvas create line" takes a considerable amount of time when the list of coordinates is not pre-shimmered before it enters the canvas. It looks like the list itself does not gain a string representation, but every double inside does gain a string representation and a type conversion to "pixel". A list of doubles with string representations appears to go around 25x faster than a list of pure doubles, at least with our particular systems and usage of the canvas. After some examination of Tk, I believe the string conversion happens in the conversion to the pixel type. I only tested this on 8.5.9.


  • Donal K. Fellows

    Tricky. The problem is that GetPixelsFromObjEx (in generic/tkObj.c) doesn't know anything about double objects. Or integer objects either.

  • Donal K. Fellows

    • labels: 104344 --> 27. Objects
    • milestone: 1199849 --> obsolete: 8.5.10
    • priority: 5 --> 7
  • Donal K. Fellows

    Fixed. May make the 8.5.11 release (we're in internal Release Candidates now).

  • Donal K. Fellows

    • assigned_to: hobbs --> dkf
    • status: open --> closed-fixed
  • Alexandre Ferrieux

    May I ask why the same type-magic is not done from within SetPixelFromAny ? (even though it has only one caller today, that might change).

  • Donal K. Fellows

    Simple: I'm not setting the type. I don't want to shimmer in this case, which means putting the logic in the getter.