I've noticed that C::B performance has a few issues on the machine I'm using at work, which is an Intel Core2 6300 running Fedora 10 with 3GB RAM. Not the most powerful box in the world, but it shouldn't be lagging.
One issue I found was that whenever the caret crossed a brace which would then be highlighted, CPU use would climb to 50% (100% on one core) momentarily. After some debugging, I pinpointed the issue to /src/sdk/wxscintilla/src/scintilla/src/Editor.cxx:
void Editor::SetBraceHighlight(Position pos0, Position pos1, int matchStyle) {
if ((pos0 != braces[0]) || (pos1 != braces[1]) || (matchStyle != bracesMatchStyle)) {
if ((braces[0] != pos0) || (matchStyle != bracesMatchStyle)) {
CheckForChangeOutsidePaint(Range(braces[0]));
CheckForChangeOutsidePaint(Range(pos0));
braces[0] = pos0;
}
if ((braces[1] != pos1) || (matchStyle != bracesMatchStyle)) {
CheckForChangeOutsidePaint(Range(braces[1]));
CheckForChangeOutsidePaint(Range(pos1));
braces[1] = pos1;
}
bracesMatchStyle = matchStyle;
if (paintState == notPainting) {
Redraw();
}
}
}
Removing the range checks removes the issue entirely:
void Editor::SetBraceHighlight(Position pos0, Position pos1, int matchStyle) {
braces[0] = pos0;
braces[1] = pos1;
bracesMatchStyle = matchStyle;
if (paintState == notPainting) {
Redraw();
}
}
However, I'm obviously not sure whether it's actually safe to remove those checks. Could someone offer insight on that point?
If there are no known issues with taking this measure, should I submit this change as a patch as described on the wiki? I only started fiddling with the C::B source today, so I'm not familiar with due process around here.