[scintilla:feature-requests] #1582 Optimize `Document::SetStyles()` and `Document::SetStyleFor()`

0 views
Skip to first unread message

Zufu Liu

unread,
Mar 9, 2026, 4:45:26 AM (yesterday) Mar 9
to scintill...@googlegroups.com

[feature-requests:#1582] Optimize Document::SetStyles() and Document::SetStyleFor()

Status: open
Group: Initial
Labels: Scintilla lexer optimization
Created: Mon Mar 09, 2026 08:45 AM UTC by Zufu Liu
Last Updated: Mon Mar 09, 2026 08:45 AM UTC
Owner: Neil Hodgson
Attachments:

Using idea of SplitView, Document::SetStyles() and Document::SetStyleFor() can be optimized to update style on each segment, this eliminated four boundary check (style.ValueAt() + style.SetValueAt()) for each byte. when precise range for ModificationFlags::ChangeStyle notification is not needed (like Document::SetStyleFor()), memcmp, memcpy, and memset can be used to set new styles, attached patch does this (use single method for CellBuffer to reduce code size, Document::SetStyleFor() and Document::SetStyles() can be changed to call a new method to reduce duplication).


Sent from sourceforge.net because scintill...@googlegroups.com is subscribed to https://sourceforge.net/p/scintilla/feature-requests/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/scintilla/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.

Neil Hodgson

unread,
Mar 9, 2026, 5:07:26 AM (yesterday) Mar 9
to scintill...@googlegroups.com

This appears to produce a larger range in the ChangeStyle notification that could require more work for the application to process.

Zufu Liu

unread,
Mar 9, 2026, 5:42:51 AM (yesterday) Mar 9
to scintill...@googlegroups.com

It's same as Document::SetStyleFor(), which report entail range as changed.


[feature-requests:#1582] Optimize Document::SetStyles() and Document::SetStyleFor()

Status: open
Group: Initial
Labels: Scintilla lexer optimization
Created: Mon Mar 09, 2026 08:45 AM UTC by Zufu Liu

Last Updated: Mon Mar 09, 2026 09:07 AM UTC
Owner: Neil Hodgson
Attachments:

Reply all
Reply to author
Forward
0 new messages