Menu

#223 Improve speed of Tk_PhotoPutBlock for one-row case

closed-accepted
9
2009-01-06
2006-08-14
Jeff Epler
No

In my application, I use tkimg1.3 to load xpm images
with transparency information.

I compared the time taken to load the image in
tk8.2+tkimg1.3 to the time taken in tk8.4+tkimg1.3:
8.2: 59086 microseconds
8.4: 769918
8.4, patched: 77059

This patch expands the 'single pixel' case into a
'single span' case: one or more pixels on a single row
of the image, where all have alpha 0 or 255. (in fact,
tkimg1.3's xpm loader always sends spans with fully
opaque pixels)

As you can see, this patch reduces the time from 13x as
long as 8.2 to only 1.3x as long as 8.2.

Discussion

  • Jeff Epler

    Jeff Epler - 2006-08-14

    patch made against tk8.4

     
  • Donal K. Fellows

    • priority: 5 --> 9
    • assigned_to: nijtmans --> dkf
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2006-08-14

    Logged In: YES
    user_id=72656

    If this was tested against 8.4.13, please test against
    8.4.12 or the cvs head. 8.4.13 had a known slowdown case in
    Tk_PhotoPutBlock.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2006-08-14
    • priority: 9 --> 6
     
  • Jeff Epler

    Jeff Epler - 2007-02-01

    Logged In: YES
    user_id=2772
    Originator: YES

    The "8.4" timings were done against tk 8.4.10.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2007-10-30

    Logged In: YES
    user_id=72656
    Originator: NO

    See also 224066

     
  • Donal K. Fellows

    • priority: 6 --> 9
     
  • Donal K. Fellows

    • status: open --> closed-accepted