Opened 5 years ago

Closed 3 years ago

#17270 closed optimization (outdated)

aui hypertreelist rendering optimization

Reported by: Chuddah Owned by:
Priority: low Milestone: 3.2.0
Component: AGW Version: 3.0.2
Keywords: Cc:
Blocked By: Blocking:
Patch: yes

Description

Profiling the aui.HyperTreeList wxPython UI component I found that It was making lots of calls to GetMultiLineTextExtent().
These calls are not too expensive, but the sheer number of these calls were cumulatively significant:

  19093505 function calls (18844101 primitive calls) in 76.539 seconds 
ncalls  tottime  percall  cumtime  percall filename:lineno(function)
 83685    0.058    0.000    2.259    0.000 wxPython/wx/_gdi.py:4139(GetMultiLineTextExtent)
 83685    2.090    0.000    2.201    0.000 {wx._gdi_.DC_GetMultiLineTextExtent}

(These are real profile stats from an arbitrary program; but are for demonstration purposes only - Your results may vary depending on what you ask AUI to do).

Looking at the source code, there are a couple of simple places that these calls can be avoided.

Damien

Attachments (1)

tabart.patch download (1.9 KB) - added by Chuddah 5 years ago.
Avoiding GetMultLineTextExtent() calls patch

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by Chuddah

Avoiding GetMultLineTextExtent() calls patch

comment:1 Changed 5 years ago by Chuddah

This patch avoids the GetMultiLineTextExtent() to calculate the extent of bold text (for when the page is active). This can be avoided if the page is not active.

I will add more patches to avoid this function when I have tested them.

Damien

comment:2 Changed 5 years ago by wbruhin

  • Component changed from wxAui to AGW

comment:3 Changed 3 years ago by robind

  • Resolution set to outdated
  • Status changed from new to closed

Closing old Phoenix tickets...

If this is still an issue in wxPython 4.0.0a1 then please open a new issue (or PR) at the wxPython-Phoenix project page on Github: https://github.com/wxWidgets/Phoenix

Note: See TracTickets for help on using tickets.