Menu

#8 Syntax highlighting makes internal editor less responsive

v5.3.1
closed
5
2016-10-04
2016-09-07
No

For some time I observed that while working on longer flows, performance degrades in the internal editor. Today I tried to narrow it down to a reproducible case and found the following:

  • I've set the below signalling flow (stripped version of an actual flow, two markers added) as the default text, and restarted the application a couple of times to reduce potential impact of undo buffers etcetera.
  • With syntax highlighting turned on (any style), typing something at the start of the file is dead slow (location of first arrow in sample). From pressing a key to something happening in the editor takes about a second. Typing a word quickly, you will see the word appear letter by letter.
  • With syntax highlighting turned on (any style), typing something at the end of the file is more responsive (location of last arrow in the sample).
  • With syntax highlighting disabled, typing anywhere is responsive.
  • With syntax highlighting turned on, undoing (Ctrl-Z) changes (fresh start, typed a new line, undoing all) is slow. This is noticable both on the start and the end of the file. It does not seem to matter if the text is typed with syntax highlighting turned off or on.

Kind regards,
Vincent de Lau

title: Some titel\n split over two lines;

NODE1, # Internal description of node 1.
NODE2, # Internal description of node 2.
NODE3, # Internal description of node 3.
NODE4; # Internal description of node 4.

..: Scenario 1: Description of Scenario
{
NODE1 <-> NODE4: Adding new content here takes\n more than 1 second per keystroke;
NODE1  -> NODE2: Message 1;
NODE2  -> NODE3: Message 2;
NODE3 <-> NODE4: Transaction 1;
NODE3  -> NODE2: Message 3;
NODE2  -> NODE4: Message 4;
NODE4  -> NODE2  -> NODE1: Message 5;
NODE4 <=> NODE2 <=> NODE1: Continuation;
};
..: Scenario 2: Description of Scenario
{
NODE1  -> NODE2: Message 1;
NODE2  -> NODE3: Message 2;
NODE3  -> NODE2: Message 3;
NODE2  -> NODE4: Message 4;
NODE4  -> NODE2  -> NODE1: Message 5;
NODE4 <=> NODE2 <=> NODE1: Continuation;
};
..: Scenario 3: Description of Scenario
{
NODE1  -> NODE2: Message 1;
NODE2  -> NODE3: Message 2;
NODE3 <-> NODE4: Transaction 1;
NODE3  -> NODE2: Message 3;
NODE2  -> NODE4: Message 4;
NODE4  -> NODE2  -> NODE1: Message 5;
NODE4 <=> NODE2 <=> NODE1: Continuation;
};
..: Scenario 4: Description of Scenario
{
NODE1  -> NODE2: Message 1;
NODE2  -> NODE3: Message 2;
NODE3  -> NODE2: Message 3;
NODE2  -> NODE4: Message 4;
NODE4  -> NODE2  -> NODE1: Message 5;
NODE4 <=> NODE2 <=> NODE1: Continuation;
NODE1 <-> NODE4: Adding new content here is reasonably responsive;
};

Discussion

  • Zoltán Turányi

    Hi Vincent,

    Thanks for the thorough bug report.

    I could not, however, reconstruct the problem. With the chart above I experience nothing close to the one second you describe.

    Syntax highlighting is otherwise an expensive operation. It is designed to be rich rather than fast, but over the years I put in many optimizations, and works reasonably well on my machine up to charts of 30K in size. Its time should not much differ between the top and bottom of the file unless large parts of the text changes color.

    What kind of CPU do you have? Which version of Msc-generator do you use?

     
  • Zoltán Turányi

    • labels: performance --> performance, GUI
    • status: open --> pending
    • assigned_to: Zoltán Turányi
     
  • Zoltán Turányi

    Due to lack of response. I close this ticket.

     
  • Zoltán Turányi

    • status: pending --> closed
     
  • Vincent de Lau

    Vincent de Lau - 2016-10-04

    Sorry for the late reply. I was using 5.3.4 at the time, on a Lenovo Yoga with an Intel Core i7 4500, 8GB RAM, SSD and Windows 8.1 Pro.

    Just installed 5.3.6 and the problem has gone away.

     

    Last edit: Vincent de Lau 2016-10-04