I added your code. But for now left it in the ifdef.
I did some measurements.
- add 250.000 lines to SynEdit (inside BegintUpdate)
- add 250.000 Carets (column bode selection on 3rd column, top to bottom, zero width)
ecEditorTop, ecRight, ecRight, ecColSelEditorBottom,
- type an "X" (with all 250 chars)
I admit 250k Carets is not normal, but inserting that many line can happen. This will also affect copy and paste or changing indent of selected lines.
times include the entire execution. Since the double width code makes only part of the time, the actual different on that code alone is much bigger.
Also for fairness, I did not optimize the embedding of your code, That is inlined the most inner call into the loop. No idea how much that would affect the result.
Accuracy can be +/- 0.1 sec
Times when compiled with all kind of debug -Criot -Sa -O1 and others
Old:
1.24
0.85
5.00
Yours:
2.48
2.05
8.83
Times when compiled without any of those and -O3
Old:
0.70
0.57
3.21
Yours:
1.34
1.21
5.21