[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.
This appears to produce a larger range in the ChangeStyle notification that could require more work for the application to process.
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: