Author Topic: Editing is lagging...  (Read 783 times)

jporkkahtc

  • Senior Community Member
  • Posts: 1684
  • Hero Points: 162
  • Text
Editing is lagging...
« on: June 28, 2017, 08:42:12 pm »
I've been noticing a lot of lag while editing lately.
It isn't entirely consistent, but it happens a lot.

Particularly bad case#1
     move the cursor around with arrows.
     wait a little bit
     try moving again and now there is a very noticeable lag before Slick responds.

Particularly bad case#2
     Click anywhere in a buffer.
     wait a little bit
     Click and drag -- very noticeable lag before the selection starts, but as long as I'm dragging, it is very responsive.

It ins't multiple seconds, but at large fraction of a second - enough to be pretty annoying.

My workspace is made of a number of projects.
Each project is a wildcard project.
    15 projects in the workspace.
    Total file count is nearly 40,000 files.
    # of workspace tag files:5
    # of bytes in workspace tag files: 213,401,600

My workspace has been like this for a long time now though, and this is a relatively recent problem.

Part of it was SymbolColoring was enabled.
I've not turned that off for AllLanguages.
I thought this fixed it, but now I'm seeing the lag again.

Currently in a *.CPP file, I see this lag for case#2, but not for case #1. Weird.
Interestingly, the lag happens in *.CPP files, but not in *.TXT files.

It is not happening when I do not have a workspace loaded.
How I tested that: Load my workspace, with the usual set of buffers loaded. Set auto-restore files, but not workspace. Restart slick: Now, I've got the same files loaded, but no workspace.



Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2542
  • Hero Points: 373
Re: Editing is lagging...
« Reply #1 on: June 30, 2017, 05:47:48 pm »
Slick-C has profiling.  Maybe you can catch it in the act.  Macro > Slick-C Profiler > Start Profiling...

jporkkahtc

  • Senior Community Member
  • Posts: 1684
  • Hero Points: 162
  • Text
Re: Editing is lagging...
« Reply #2 on: June 30, 2017, 08:48:06 pm »
Yeah yeah, I'm just too lazy... ;D
OK, so I tried it.

#1: The lagging for cursor movement seems to be due to the Preview window being open.
I closed preview, and now cursoring around is nice and snappy.

#2: The mouse clicking lag is due to debug_get_mouse_expr().
I put "return('');" first thing in that function and now clicking around is snappy.

The profile shows this function called 39 times, F+DTime is 4420, and Percent is 94%
The profile here isn't exactly obvious though, as debug_get_mouse_expr is called by _mouse_move.
mou_click is called 6 times, F+D=150 and Percent=3.2%.

So how does disabling debug_get_mouse_expr() affect the click response time then?


Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2542
  • Hero Points: 373
Re: Editing is lagging...
« Reply #3 on: June 30, 2017, 09:57:32 pm »
There's an option for the mouse hover stuff.

Document > C/C++ Options > Context Tagging(R) > Highlighting and Completion > Show Info for symbol under mouse.

Preview can be tricky.  If your cursor is on a symbol that is defined in a large file, or a remote file, pulling up the file can be a bit expensive.  It's done on a inactivity timer, but sometimes the timing can be just so it got started right before you wanted SlickEdit's attention back.  We're planning on working on this in a future release, do more of the work on a thread, and then show the results when they are fully ready, but it is a lot of work to get there.

jporkkahtc

  • Senior Community Member
  • Posts: 1684
  • Hero Points: 162
  • Text
Re: Editing is lagging...
« Reply #4 on: June 30, 2017, 11:16:25 pm »
OK, turning off that option fixes it - so I put debug_get_mouse_expr() back as it was.'
WRT Preview: I'm seeing this on local files.
WRT threads: Yeah, this is tough to do - and likely to be destabilizing.