Release
• 20 Jul 2015
Update 1
• 30 Nov 2015
Update 2
• 30 Mar 2016
Update 3
• TBD
6#
BUILD
DEBUG
EDIT
Developer does this #40 times a day
(Linker)
CLEAN BUILD
Product build nightly!
(Compiler)
• VS2015 linker is on average 2x faster when performing a clean link for Non Whole Program Optimized builds.
• VS2015 linker is multi-x faster for new edits now supported by incremental linking.
680
138
84
573
68
61
8
327
KIN E C T S PO R TS R IV AL ( X BO X
O NE )
F O R Z A ( XBO X O NE ) DE S TINY ( XBO X O NE ) C HR O ME
CLEAN LINK TIMES WITH VS2015 (SEC)
VS2013 RTM VS2015 RTM
• /Debug:fastlink
• /Zc:inline
• Incremental linking for
static libraries
• Linker multi-threading
VS2015 introduces…
• Whole Program Optimized (WPO) or LTCG builds perform optimizations
(Inlining, Register Allocation, Value Propagation) across source files and across modules.
• WPO improves runtime performance by low single digits (CPU).
• Minor edits in source code today result in full code generation for WPO builds.
• /ltcg:incremental makes these changes incremental in nature without sacrificing code-quality.
Incredibuild and Visual Studio
• Incredibuild is a software acceleration technology which accelerates Visual Studio, Continuous delivery
and development tool
• Incredibuild and Visual Studio partnership only in 2015 offers the following features as a part of the free SKU.
• A better granular build plan which breaks down false dependencies to maximize build parallelism
• Intelligent resource management
• Visualization tools to understand your build bottle-necks
All in all ~10% improvement in overall build time.
6:32
4:42
0:47
Visual Studio IncrediBuild
(Predicted)
IncrediBuild
(With Helpers*)
• Helper machines are desktop machines containing 2-4 cores each
• Based on Ace open source benchmark
Incredibuild and Visual Studio
“Acquire Incredibuild easily via the File->New, ‘Build Accelerator’ menu’”
faster
void blackscholes(float* input, int *signArray, int n)
{
for (int i = 0; i < n; i++) {
float InputX = input[i];
int sign;
if (InputX < 0.0f) {
InputX = -InputX;
sign = 1;
} else {
sign = 0;
}
input[i] = InputX;
signArray[i] = sign;
}
}
mask = InputX < 0.0f ? 0xFFFFFFFF : 0;
InputX = (mask & -InputX) | (~mask & InputX);
sign = (mask & 1) | (~mask & 0);
Optimized to branch-less code
300%+ speedup in
blackscholes benchmark
Vectorization of control-flow
faster
Vectorization of control-flow
Bit-test merging
faster
Vectorization of control-flow
Bit-test merging
Loop-if unswitching
for (int i = 0; i < 100; i++)
if (some_invariant_condition)
...
Source code:
if (some_invariant_condition)
for (int i = 0; i < 100; i++)
...
Optimized as if:
faster
Vectorization of control-flow
Bit-test merging
Loop-if unswitching
Other code-generation improvements
• Better vectorization of STL constructs (range based for-loops, std::vector)
• Vectorization under /O1 (optimize for size)
• Better codegen of std::min/std::max (200% improvement in runtime)
• Arm32 performance improvements, aggressive scheduler pairing opt,
EH optimizations, whole program type de-virtualization.
• Improve Pre-exec optimizations.
secure
/Guard:cf – new compiler switch
• Protects your instruction stream
• At compile time analyzes control flow for all indirect targets and then inserts code
to verify the targets at runtime.
Learn more about /Guard:cf
secure
/Guard:cf – new compiler switch Learn more about /Guard:cf
Intel®Memory Protection Extensions (MPX) support Learn more about MPX
• New hardware instructions to help mitigate potential buffer overflows (statically and
dynamically allocated buffers).
• Experimental compiler flag /d2MPX to enable automatic MPX code generation.
Intel MPX Enabling Guide
#6
5#
std::string s = "nSome reasons this string is hard
to read:nt1. It would go off the screen in your
editornt2. It has sooooo many escape
sequences.nnThey should make a type for this called
"long" string, har har har.nnHave fun parsing
this! (maybe?)n";
std::string s = R"(
Some reasons this string is hard to read:
1. It would go off the screen in your editor
2. It has sooooo many escape sequences.
They should make a type for this called "long" string, har har har.
Have fun parsing this! (maybe?)
)";
#6
#5
4#
#6
#5
#4
3#
C++17
constexpr Expression SFINAE Two-phase lookup
Variable templates Extended constexpr
NSDMI for aggregates
coroutines modules concepts Nested namespace Folded expressions
https://github.com/isocpp/CppCoreGuidelines
Your code will be:
• good modern C++,
• simpler and safer,
• which leads to less resource leaks
and logic errors
https://www.nuget.org/packages/Microsoft.CppCoreCheck https://www.nuget.org/packages/Microsoft.Gsl/
https://github.com/Microsoft/GSL
With Core Checkers
Don't use pointer arithmetic. Use span instead. (bounds.1)
Variable 'n' is uninitialized. Always initialize an object. (type.5)
Don't use pointer arithmetic. Use span instead. (bounds.1)
Don't use pointer arithmetic. Use span instead. (bounds.1)
Don't use pointer arithmetic. Use span instead. (bounds.1)
C26481
C26494
C26481
C26481
C26481
1. void f(int* p, int count)
2. {
3. if (count < 2) return;
4. int* q = p + 1;
5.
6. ptrdiff_t d;
7. int n;
8. d = (p - &n);
9.
10. p[4] = 1;
11. p[count - 1] = 2;
12. use(&p[0], 3);
13.}
14.
15.std::unique_ptr<int[]> a
16. (new int[10]);
17.f(a.get(), 10);
1. void f(int* p, int count)
2. {
3. if (count < 2) return;
4. int* q = p + 1;
5.
6. ptrdiff_t d;
7. int n;
8. d = (p - &n);
9.
10. p[4] = 1;
11. p[count - 1] = 2;
12. use(&p[0], 3);
13.}
14.
15.std::unique_ptr<int[]> a
16. (new int[10]);
17.f(a.get(), 10);
With Core Checkers
C26481
C26494
C26481
C26481
C26481
After (with GSL)
1. void f(gsl::span<int> a)
2. {
3. if (a.length() < 2) return;
4. gsl::span<int> q = a.subspan(1);
5. [[suppress(type.5)]] {
6. ptrdiff_t d;
7. int n;
8. d = (a.data() - &n);
9. }
10. a[4] = 1;
11. a[a.length() - 1] = 2;
12. use(a.data(), 3);
13.}
14.
15.std::unique_ptr<int[]> a
16. (new int[10]);
17.f({ a.get(), 10 });
#6
#5
#4
#3
2#
#6
#5
#4
#3
#2
1#
1#
Description
Build your android application with Gradle build system and easily reference other
android libraries.
Feature Capabilities
• State of the art coding experience with Java and C++
• Powerful debugging for your Java and C++ code
• Gradle Build System
• Ant Build System
• Referencing Android libraries (.aar, .jar) easily in your Android Code.
• Logcat integration
• Fast emulation
• Jump start development with templates and samples
Description
Easily import your Xcode project into Visual Studio and get started with
iOS development within Visual Studio from Windows.
Feature Capabilities
• Import from Xcode, project wizard
• Open in XCode
Learn more about Clang with Microsoft Codegen
#ifdef (specific_compiler_implementation)’
File-> New-> Cross Platform->
#6
#5
#4
#3
#2
#1
0#
http://visualstudio.uservoice.com
http://connect.microsoft.com https://social.msdn.microsoft.com/Forums/en-US/home?forum=vcgeneral
For more info: https://blogs.msdn.microsoft.com/visualstudio/2015/07/30/visual-studio-customer-feedback-channels/
Status User Voice
COMPLETED Include gamma functions in math.h
COMPLETED Single file IntelliSense
COMPLETED Separate ship line of Visual C++ compiler from Visual Studio IDE
COMPLETED Make C/C++ compiler (cl.exe) independent of IDE
COMPLETED Decouple C++ compiler releases from Visual Studio releases
COMPLETED Automate the installation of boost
COMPLETED Fix IntelliSense performance
COMPLETED Working Intellisense in C++
COMPLETED the IntelliSense is slow when "Parsing files in solution" in VS 2015, please speed it up
COMPLETED C++ has the same templates as Visual Basic and C#
COMPLETED Add options to turn off parts of IntelliSense
COMPLETED Bring Visual C++ up to par with open source programs such as Eclipse and Netbeans
COMPLETED One tab for .cpp and .h files
COMPLETED One-button switch between header and implementation file
COMPLETED C++ Edit and Continue in the new debug engine
COMPLETED x64 Edit and Continue for C++
COMPLETED Improve MFC
COMPLETED Add support for binary literals in C++
COMPLETED Provide refactoring for C++
COMPLETED Support C++11 features
COMPLETED Multithreaded C/C++ linker
COMPLETED Do not treat IntelliSense output as errors in Error List
COMPLETED Improve C++ intellisense for pointers
IN PROGRESS Support natvis debug visualizers in Mixed mode debugging
Top 10 contributors
David Majnemer (33)
Bruce Dawson2 (26)
Marcel Raad (23)
Michael Winterberg (18)
Debugini (17)
Kaba_ (15)
bogdan I (12)
Fred J. Tydeman (12)
Trass3r (11)
Niels Dekker (11)
#6
#5
#4
#3
#2
#1
#0
http://aka.ms/VDevLabs2015
Channel 9
Microsoft Virtual Academy
Build 2016 - B880 - Top 6 Reasons to Move Your C++ Code to Visual Studio 2015

Build 2016 - B880 - Top 6 Reasons to Move Your C++ Code to Visual Studio 2015

  • 4.
    Release • 20 Jul2015 Update 1 • 30 Nov 2015 Update 2 • 30 Mar 2016 Update 3 • TBD
  • 5.
  • 7.
    BUILD DEBUG EDIT Developer does this#40 times a day (Linker) CLEAN BUILD Product build nightly! (Compiler)
  • 8.
    • VS2015 linkeris on average 2x faster when performing a clean link for Non Whole Program Optimized builds. • VS2015 linker is multi-x faster for new edits now supported by incremental linking. 680 138 84 573 68 61 8 327 KIN E C T S PO R TS R IV AL ( X BO X O NE ) F O R Z A ( XBO X O NE ) DE S TINY ( XBO X O NE ) C HR O ME CLEAN LINK TIMES WITH VS2015 (SEC) VS2013 RTM VS2015 RTM • /Debug:fastlink • /Zc:inline • Incremental linking for static libraries • Linker multi-threading VS2015 introduces…
  • 9.
    • Whole ProgramOptimized (WPO) or LTCG builds perform optimizations (Inlining, Register Allocation, Value Propagation) across source files and across modules. • WPO improves runtime performance by low single digits (CPU). • Minor edits in source code today result in full code generation for WPO builds. • /ltcg:incremental makes these changes incremental in nature without sacrificing code-quality.
  • 10.
    Incredibuild and VisualStudio • Incredibuild is a software acceleration technology which accelerates Visual Studio, Continuous delivery and development tool • Incredibuild and Visual Studio partnership only in 2015 offers the following features as a part of the free SKU. • A better granular build plan which breaks down false dependencies to maximize build parallelism • Intelligent resource management • Visualization tools to understand your build bottle-necks All in all ~10% improvement in overall build time. 6:32 4:42 0:47 Visual Studio IncrediBuild (Predicted) IncrediBuild (With Helpers*) • Helper machines are desktop machines containing 2-4 cores each • Based on Ace open source benchmark
  • 11.
    Incredibuild and VisualStudio “Acquire Incredibuild easily via the File->New, ‘Build Accelerator’ menu’”
  • 12.
    faster void blackscholes(float* input,int *signArray, int n) { for (int i = 0; i < n; i++) { float InputX = input[i]; int sign; if (InputX < 0.0f) { InputX = -InputX; sign = 1; } else { sign = 0; } input[i] = InputX; signArray[i] = sign; } } mask = InputX < 0.0f ? 0xFFFFFFFF : 0; InputX = (mask & -InputX) | (~mask & InputX); sign = (mask & 1) | (~mask & 0); Optimized to branch-less code 300%+ speedup in blackscholes benchmark Vectorization of control-flow
  • 13.
  • 14.
    faster Vectorization of control-flow Bit-testmerging Loop-if unswitching for (int i = 0; i < 100; i++) if (some_invariant_condition) ... Source code: if (some_invariant_condition) for (int i = 0; i < 100; i++) ... Optimized as if:
  • 15.
    faster Vectorization of control-flow Bit-testmerging Loop-if unswitching Other code-generation improvements • Better vectorization of STL constructs (range based for-loops, std::vector) • Vectorization under /O1 (optimize for size) • Better codegen of std::min/std::max (200% improvement in runtime) • Arm32 performance improvements, aggressive scheduler pairing opt, EH optimizations, whole program type de-virtualization. • Improve Pre-exec optimizations.
  • 16.
    secure /Guard:cf – newcompiler switch • Protects your instruction stream • At compile time analyzes control flow for all indirect targets and then inserts code to verify the targets at runtime. Learn more about /Guard:cf
  • 17.
    secure /Guard:cf – newcompiler switch Learn more about /Guard:cf Intel®Memory Protection Extensions (MPX) support Learn more about MPX • New hardware instructions to help mitigate potential buffer overflows (statically and dynamically allocated buffers). • Experimental compiler flag /d2MPX to enable automatic MPX code generation. Intel MPX Enabling Guide
  • 18.
  • 19.
  • 22.
    std::string s ="nSome reasons this string is hard to read:nt1. It would go off the screen in your editornt2. It has sooooo many escape sequences.nnThey should make a type for this called "long" string, har har har.nnHave fun parsing this! (maybe?)n"; std::string s = R"( Some reasons this string is hard to read: 1. It would go off the screen in your editor 2. It has sooooo many escape sequences. They should make a type for this called "long" string, har har har. Have fun parsing this! (maybe?) )";
  • 25.
  • 26.
  • 29.
  • 30.
  • 31.
    C++17 constexpr Expression SFINAETwo-phase lookup Variable templates Extended constexpr NSDMI for aggregates coroutines modules concepts Nested namespace Folded expressions
  • 33.
    https://github.com/isocpp/CppCoreGuidelines Your code willbe: • good modern C++, • simpler and safer, • which leads to less resource leaks and logic errors
  • 34.
  • 35.
    With Core Checkers Don'tuse pointer arithmetic. Use span instead. (bounds.1) Variable 'n' is uninitialized. Always initialize an object. (type.5) Don't use pointer arithmetic. Use span instead. (bounds.1) Don't use pointer arithmetic. Use span instead. (bounds.1) Don't use pointer arithmetic. Use span instead. (bounds.1) C26481 C26494 C26481 C26481 C26481 1. void f(int* p, int count) 2. { 3. if (count < 2) return; 4. int* q = p + 1; 5. 6. ptrdiff_t d; 7. int n; 8. d = (p - &n); 9. 10. p[4] = 1; 11. p[count - 1] = 2; 12. use(&p[0], 3); 13.} 14. 15.std::unique_ptr<int[]> a 16. (new int[10]); 17.f(a.get(), 10);
  • 36.
    1. void f(int*p, int count) 2. { 3. if (count < 2) return; 4. int* q = p + 1; 5. 6. ptrdiff_t d; 7. int n; 8. d = (p - &n); 9. 10. p[4] = 1; 11. p[count - 1] = 2; 12. use(&p[0], 3); 13.} 14. 15.std::unique_ptr<int[]> a 16. (new int[10]); 17.f(a.get(), 10); With Core Checkers C26481 C26494 C26481 C26481 C26481 After (with GSL) 1. void f(gsl::span<int> a) 2. { 3. if (a.length() < 2) return; 4. gsl::span<int> q = a.subspan(1); 5. [[suppress(type.5)]] { 6. ptrdiff_t d; 7. int n; 8. d = (a.data() - &n); 9. } 10. a[4] = 1; 11. a[a.length() - 1] = 2; 12. use(a.data(), 3); 13.} 14. 15.std::unique_ptr<int[]> a 16. (new int[10]); 17.f({ a.get(), 10 });
  • 37.
  • 38.
  • 41.
  • 42.
  • 43.
  • 46.
    Description Build your androidapplication with Gradle build system and easily reference other android libraries. Feature Capabilities • State of the art coding experience with Java and C++ • Powerful debugging for your Java and C++ code • Gradle Build System • Ant Build System • Referencing Android libraries (.aar, .jar) easily in your Android Code. • Logcat integration • Fast emulation • Jump start development with templates and samples
  • 47.
    Description Easily import yourXcode project into Visual Studio and get started with iOS development within Visual Studio from Windows. Feature Capabilities • Import from Xcode, project wizard • Open in XCode
  • 48.
    Learn more aboutClang with Microsoft Codegen #ifdef (specific_compiler_implementation)’ File-> New-> Cross Platform->
  • 49.
  • 50.
  • 51.
    http://visualstudio.uservoice.com http://connect.microsoft.com https://social.msdn.microsoft.com/Forums/en-US/home?forum=vcgeneral For moreinfo: https://blogs.msdn.microsoft.com/visualstudio/2015/07/30/visual-studio-customer-feedback-channels/
  • 52.
    Status User Voice COMPLETEDInclude gamma functions in math.h COMPLETED Single file IntelliSense COMPLETED Separate ship line of Visual C++ compiler from Visual Studio IDE COMPLETED Make C/C++ compiler (cl.exe) independent of IDE COMPLETED Decouple C++ compiler releases from Visual Studio releases COMPLETED Automate the installation of boost COMPLETED Fix IntelliSense performance COMPLETED Working Intellisense in C++ COMPLETED the IntelliSense is slow when "Parsing files in solution" in VS 2015, please speed it up COMPLETED C++ has the same templates as Visual Basic and C# COMPLETED Add options to turn off parts of IntelliSense COMPLETED Bring Visual C++ up to par with open source programs such as Eclipse and Netbeans COMPLETED One tab for .cpp and .h files COMPLETED One-button switch between header and implementation file COMPLETED C++ Edit and Continue in the new debug engine COMPLETED x64 Edit and Continue for C++ COMPLETED Improve MFC COMPLETED Add support for binary literals in C++ COMPLETED Provide refactoring for C++ COMPLETED Support C++11 features COMPLETED Multithreaded C/C++ linker COMPLETED Do not treat IntelliSense output as errors in Error List COMPLETED Improve C++ intellisense for pointers IN PROGRESS Support natvis debug visualizers in Mixed mode debugging
  • 53.
    Top 10 contributors DavidMajnemer (33) Bruce Dawson2 (26) Marcel Raad (23) Michael Winterberg (18) Debugini (17) Kaba_ (15) bogdan I (12) Fred J. Tydeman (12) Trass3r (11) Niels Dekker (11)
  • 54.
  • 56.
  • 59.