Editing and typing is slow in VS 2017

k. if we could get this as a test case that’d be cool.

Does it compile ok? how does it behave in Water?

You don’t receive the private message with the download link for the test case?
It was sent 6 hours ago.

I’ve reverted to Elements 9 in between, but I can make a test under Water if you really want.

@mh and @viktoriad

If I looked at what happens when there is an error in a code file, it looks like the CC is being rebuild each time it is being showed. I think that is what is causing the slowness.
I think it is enough to rebuild the CC when:

  1. solution is loaded
  2. a project is added or removed
  3. a file is added or removed
  4. code is being commented or de-commented
  5. when a ; is typed.

In all other cases, just use the cached version.
And another point of interest: rebuild it in a background thread.

This makes sure that the CC is never being rebuild at the time you want to see it (and therefor you have to wait for it) and it is never being rebuild unnecessary; it is only being rebuild when it could have changed.

Edit: And another point: Don’t check the code for errors on each space that is being typed - this is also only needed when a line is completed ( the ; ) or code is being (de-)commected.

Yeah… that’s. not what’s happening.

the code model is only being updated when needed (ie when code changes, not when CC is invoked), and it is being updated in the background (of course. else you could say good-bye to efficient typing in the smallest of files).

The problem is that when said background update is a 8GB/120minute job with a project of your size, it still slows things down for the whole system.

The last one is happening.
The complete code unit is checked on every space.
So, with a big unit, all code is parsed every time you press space.
And I am not talking about that size of project now. Just normal, handmade units.

To see what I mean:

Create a new unit, with the following type in it:

type x = class
end;

Then in the implementation section type:

method x.y;
begin

end;

Then type between the begin and end (do not type Ctrl-Shift-C):

var qwertyuiop: Integer;

You can type var.
On the space “Type “x” does not contain a declaration that matches this method signature: method x.y” is logged
And the same message is logged on any letter of the variable name that you type, what means that the class is syntax checked on every keypress.

ill leave this for carlo or vika to answer on monday, as this is not my area of expertise…

The code model gets updated on every key press yes, this happens in the background (unless you actually trigger CC then it waits for it to complete) so that all the info the IDE has get updated while you type (For example, to jump to the right type when using navigation or goto definition, we need to know the exact range of a method). This shouldn’t actually affect the typing speed though.

But it looks like it does.
Try it in one of the huge units.

i guess the problem might be when auto cc is on, ie any keepers tries to open up the cc popular, carlo?

Don’t know what you did, but it is now on an acceptable level with a 64k line file (about a second per keystroke instead of 10th of seconds). :smile:

2 Likes

I did some tweaks yeah. Still not very happy about it but will try to solve more later.

1 Like

Same problem here (since a few versions)…

Current Elements preview

The project (WinForms) is nearly empty, just a few controls on a form and nearly no code…

This bug is more than annoying… :confused:

This is another one.
The one we talking about is the typing performance:
image

I have the one you talk about too - but this is caused by the fact that Visual Studio itself is getting more pickier on extensions. Just click “Never show this message again” and you won’t get it anymore until you upgrade either Visual Studio or Elements.

But typing IS slow in my case. If the reason is CC or whatever - don’t know.

The message from your screenshot is displayed here from time to time, too, but my project(s) are WAY SMALLER than yours…

Can you give us your project? It might be something specific to it.

I’m not allowed to do so, sorry…

But i don’t believe it is specific to my project. I have seen this message(s) several times the last few weeks (normally newest preview of Elements) in different “Fiddling-Around”-projects. That kind of (usually WinForms) project with one form, one or two buttons, a textbox and some lines of code for testing some stuff…

Is this Island or .NET?

Can you attach 1 vs to another vs and note down any exceptions + callstack you find?

Are these with 2339, or with 2337 or earlier? .only .2339 as the (incomplete, but a good start) improvements Carlo has made.

.NET only, as far as i remember. (Haven’t used Island really yet.)

.2339 and earlier. I can’t really remember when it started, a few weeks in any case.

As i use Oxygene only occasionally in the last few weeks, i really can’t be more specific.
When i decided to report this problem, i saw topics in this forum regarding this already, so i kept my feets still.

I reported it now, because you reported progress in this topic regarding abnormal huge projects… I only wontet to mention, that these messages may be displayed in projects with less than 100 loc…

E.g.: Something like this was the only “handwritten” code in the project (.net, Winforms, AnyCpu, 4.7.2) that caused the message in my screenshot…

method MainForm.splitter1_Paint(sender: System.Object; e: System.Windows.Forms.PaintEventArgs);
begin
  var lSplitter := Splitter(sender);

  // Calculate the position of the points
  var points := new Point[3];
  points[0] := new Point(lSplitter.Width / 2, lSplitter.Height / 2);
  points[1] := new Point(points[0].X, points[0].Y - 5);
  points[2] := new Point(points[0].X, points[0].Y + 5);
  points[      <<<<<---- Typing this was really slow and made VS show the message (after typing "[") again...

  for each p: Point in points do 
  begin
    p.Offset(-1, -1);
    e.Graphics.FillEllipse(SystemBrushes.ControlLightLight, new Rectangle(p, new Size(3, 3)));
    p.Offset(-1, -1);
    e.Graphics.FillEllipse(SystemBrushes.ControlDark, new Rectangle(p, new Size(3, 3)));
  end;
end;

image