Win32 DBCS optimization and code break up

21 views
Skip to first unread message

Neil Hodgson

unread,
Mar 27, 2025, 9:14:40 PMMar 27
to scintilla-interest
Case-insensitive search for East Asian DBCS encodings on Win32 has been sped up by a factor of around 5 times. This is done by caching character folding data and costs 64K for each DBCS code page used. There is no significant extra memory use if DBCS encodings are not used. This change may be extended to other platforms in the future.

The initial plan was to add cross-platform character folding data but, unfortunately, platforms and APIs vary in their behaviour and can be modified with OS patches and locale settings.

I believe the memory cost is justified by the improved performance and there may be more movement in this direction later. For example, a look-up table from DBCS encodings to Unicode and back may be implemented to avoid operating system calls for conversions.

The PlatWin.cxx file had become too large so has been broken up into 4 files: SufaceGDI.cxx and SurfaceD2D.cxx contain drawing code for the Win32 GDI and Direct2D/DirectWrite APIs; ListBox.cxx implements the autocompletion list box; and PlatWin.cxx retains the window, screen, menu, cursor, bitmap and platform-access functions.

Projects maintaining their own project or makefiles may need to make corresponding changes.

The committed changes can be examined either in the repositories

hg clone http://hg.code.sf.net/p/scintilla/code scintilla

or from

https://www.scintilla.org/scite.zip Source
https://www.scintilla.org/wscite.zip Windows executable (64-bit)

Neil
Reply all
Reply to author
Forward
0 new messages