Ticket #9012 (closed optimization: fixed)

Opened 3 years ago

Last modified 16 months ago

wxTextCtrl::AppendText Mac Unicode Optimization

Reported by: whschultz Owned by: csomor
Priority: normal Milestone:
Component: wxOSX-Carbon Version:
Keywords: Cc: whschultz, csomor
Blocked By: Patch: yes
Blocking:

Description

If you call AppendText many times on a wxTextCtrl that is full of text, there is a rather obvious slowdown. I narrowed this down to wxMacMLTEControl::GetLastPosition.

The existing implementation converts the text to ASCII in order to find the last position. If the text is already in ASCII (non-unicode build), this isn't an issue (I didn't test). If the text unicode, this is a huge issue.

This patch finds the last position in a unicode build without converting the contents of the wxTextCtrl to ASCII.

Attachments

textctrl_optimization.diff download (0.9 KB) - added by whschultz 3 years ago.
wxMacMLTEControl::GetLastPosition unicode-friendly

Change History

Changed 3 years ago by whschultz

wxMacMLTEControl::GetLastPosition unicode-friendly

Changed 2 years ago by wxsite

  • status changed from assigned to confirmed

transitioning old 'assigned' status to new 'confirmed' status

Changed 2 years ago by wojdyr

  • type set to optimization

Changed 16 months ago by CL

The patch is very straightforward and it works. I'd like to urge the maintainers to apply it.

Changed 16 months ago by csomor

thanks for the testing and for the ping, I'll commit it

Changed 16 months ago by SC

  • status changed from confirmed to closed
  • resolution set to fixed

(In [60637]) applying, closes #9012

Changed 16 months ago by SC

(In [60638]) applying, closes #9012

Note: See TracTickets for help on using tickets.