Visual studio performance and victor is the engineering
Manager on performance so for all your performance stuff you
Know who to blame! [laughter] thank you for coming.
I understand it's lunchtime so if any of you are eating food we
Don't mind at all. We had a late brunch so we are
Full. But feel free to eat.
Since it can be a fairly large topic to cover, someone told me
They wished they had an entire day to talk about this with me
But we have 20 minutes so i'm going to set expectations of what we will cover in the
Session. We will talk about a lot of
Stuff we have done in the last year, quick, and then we will
Actual demo you live. Victor will open visual studio
And demo live how significant choices can impact performance.
After that we will talk about hardware issues.
This is my favorite slide of course we have worked a lot in
The last one year and i will actually show you a video that i
Think you probably saw in the keynote as well if you went to
That but we have made significant improvements in performance.
In just last one year. This is the video.
We are comparing not 2015 but actually just 2017 from last
Year, and 15.7 Update that just got released.
You can see it's a very large solution that we are going to
Load in both versions. So significant difference you
Will see. In addition we have redesigned
The test discovery process as well so it does not require a rebuild.
You see that loads significantly faster and in the demo victor is
Going to show you how certain choices can make your solution
Load longer. We will go over those tips as
Well. This is both cases being
Compared. In addition, the test discovery
Does not require a build, it just starts on its own after
Solution has been load and huge improvement in solution load
Performance as well. So if you are using 2015, or
Even 2017 from last year, you can get a lot faster performance
Just by upgrading to 15.7. So when you go back, basically
Please let your colleagues, your team know that upgrading is
Going to help solve a lot of performance issues for them.
This is the question we get a lot from
A slide up there for this. A developer is upgrading
Hardware and they want to know what makes a significant difference.
We looked at symmetry, millions of solution loads and we
Analyzeded in a lab as well and we find that while all three
Play a role, ssds have the most dramatic affect.
They can make your solution load on an average, three times
Faster, in some cases six to seven times faster as well.
The good thing about ssds, they can be upgraded without
Necessarily upgrading the full box.
We did it at microsoft and a lot of teams and our developers are
Happy. All the managers in the house a
Nice way to increase your whi scores for your employees.
Now without further ado i invite victor to show you live on
Visual studio, he will open both cases and show you how options
That you choose can make a dramatic difference in the
Environment. >> Thank you, room!
I'm victor, i'm an engineering manager in visual studio.
Today i will show techniques that will help you work with
Your solution faster.
We will start with three things that apply to small solutions
And large solutions. This is a small solution.
It has one web application and one test project. Many developers have a habit of
Closing visual studio before going home.
Let's say we're back next morning, ready to start and we
Open the solution. Visual studio starts and takes
Time to open the solution. It is parsing the solution file,
Parsing the project files and opening documents and windows
That were open. Sometimes it takes time to
Figure out dependencies between projection and calculate
Intelligence. There are reasons why it takes
So long to load. First look at these documents
Hanging around, they take time to initialize.
The window that i personally need out of solution load is a
Solution explorer, let's hide other windows.
This will also give us more real estate to work with our
Documents. You can see the favorite
Windows layouts here and switch to them.
Look at what visual studio restored for us, convenient if
We want to enter the same code but often we don't.
In this case it's a good habit to close documents when we no
Longer need them. My third solution is to keep
Visual studio running, it creates memory and it's ready to
Open more projects, more files quickly but when you press this
X button, the status has to be recreated.
So when we are done working with our solution we are going to
Clues the solution but keep visual studio running.
When we are ready to work on the solution again we will select it
From here. Did you see how fast it was?
I will do this again in case anybody blinked.
[Chuckles] click, ready!
You can still access our windows quickly, we can open our
Documents, visual studio remains fast and fluid.
To summarize, your solution will experience a dramatic difference
Based on how we configure our environment. Next let's talk about large
Solutions. I will use the website which is
An open source content management project it's on
Github so you can try it yourself.
Working in git we will start with working a new feature, so
We will connect locally, go to branches, and we can create a
New branch from here. People who branch from a local
Master often end up doing daily merges between two local
Branches and several branches a day this is an expensive work
Flow. It's better to branch from a
Remote region, right here. Let's name
Our branch. It is important to get to the
Right branch before opening a solution, otherwise we will have
To wait for visual studio to do this throw-away work parsing
Files that are about to change. We are on the right branch now
So let's open the solution. This is a sizable solution.
Is has 88 projects and it will take several seconds to load.
Yet it is much faster than before, thanks to a performance
Optimization we recently did in visual studio.
What is the first thing we like to do in the large and familiar
Codebase. Often we search.
The fastest solution is to press control t.
Let's figure out how buttons are organized on the orchard
Website. Visual studio will search file
Names, types and members of these types and we can further
Filter down to classes and quickly find what we are looking for.
So fast solution load and search are great but we want more.
How many times a day do we build?
A lot. Visual studio saves us time by
Not contributing projection that didn't change from the previous
Build, however, this solution has one project that wants to
Build every time, even if we changed nothing!
So we're going to fix that and learn couple tricks along the way.
In addition to opening solutions, visual studio
Supports opening folders, right here.
This is convenient if you are
Am -- if you don't have projects and solutions or if you want to
Make an edit in the large solutions.
So open the orchard code. Time to open folder doesn't
Depend on the folder size. It is like opening it in file
Explorer. Find the project.
Here it is, pretty fast. Next, we're going to check if
This project includes files that always must be copied.
It does. This line right here, it forces
Visual studio to build this project even if nothing has
Deigned. If you see this, question it.
We're going to fix that by replacing always with preserve
Newest. While we are looking at the
Project structure i'm going to show you one more thing.
This several lines tells visual studio to include files from
Subfolders of this project, some developers like to express the
Same thing called global patterns, and let me show you
What that looks like. This is a global pattern, double
Asterisk, it tells visual studio visual studio to include files
From subfolders on this project. This is fine if that number is
Small but it also has it scanning folders at solution
Load so imagine if you had something like this, it will
Force visual studio to scan the entire disk so imagine how fast
This is going to be. This is an extreme example from
One of our customers that had something like that.
So this is a large folder with shared components.
This line added 6 minutes to each solution load.
Just imagine 6 minutes every day across developers, globaling is
A powerful tool but use it carefully.
Slight changes can have a huge impact on our solution load,
Build, and other scenarios. You can diagnose and fix some of
These solutions yourself by searching for "ales" our a
Double asterisk in your folder. You can check out project
Systems tools and it can give you much detailed diagnostics.
I'm going to undue our globaling changes.
We will close the folder and get back to the solution.
To verify build fix. When we build this solution
First time, we expect that the project which has changed, it
Will be built. However when we build the solution again we expect
Something different. So let's test it.
Pay attention to the output pane that will show up in a second
And time it takes to build this project and this solution.
So we build this project, that's do that again.
Build. It is faster now so we just
Saved time for orchard developers, if 1dl doesn't sound
Like a huge deal to you please keep in mind this accumulates
And it is worth time to clean them up.
Build? debugging.
Let's start debugging and you may notice that it takes time to
Start debugging for this solution.
Pay attention to the bottom left corner where visual studio will
Tell us it is loading symbol files that map source code with
Buy nears and visual studio needs to load them to bridge
These two world's. One of the ways to speed up
Debugging is to load less symbols.
There are several ways to do that and we will look today in
The just my code setting. So to get to
It, type "just my
Code" the setting right here in the middle of the screen tells
Visual studio when it is selected and tell us visual
Studio to only load symbols from projections in the solution.
It is in the old by default but sometimes people disable it and
Forget to reenable it. Let's check it first.
If our selection is huge and we want to further limit the number
Of symbols we can be more specific and filter.
Orchard project is not that huge so i will skip this step.
Let's start debugging. Visual studio will load less
Symbols because we enabled just my code setting.
It will not be able to debug each of the system libraries,
Put break points there but this is the key for most debugging
Tasks. The good news is that the
Debugging starts faster now. To summarize we saw how to speed
Upload, branch, selection, and debug.
Happy coding. [Applause]
>> Thank you so much, victor. So we saw all these, un,
Suggestions and we saw the video, but we understand that
You may still see slower performance on some machines and
We have a tool in visual studio
And it has a unique functionality that we absolutely love.
It is a record button which you can use to record the exact
Problem you are seeing. It will record the steps as well
As all diagnostic information that we need in order to
Simulate and not understand what's causing the slow down.
For example the 6-minute solution load time that victor
Describes, we saw it at least with a few dozen customers we
Were able to look through what was happening because of the
Record functionality. Please use this.
We absolutely -- it is super useful for us to investigate.
Without it it's hard to find out what's been going on on your
Machine on your solution. All the content that we are
Sharing today and much more content that we are not able to
Share because of lack of time it will be all present on this
Short link, aka dot ms. Our email addresses are here.
If you would like to discuss anything further or special
Issues you are seeing we will be hanging around here and email
Us. We can arrange a conference call
Afterwards as well. Thank you for coming.