performance compatibility portability 1. 2. 3. 4. Performance Compatibility Portability Productivity Connected Windows Store Apps Visual Studio 2013 makes it easier to: • Update your app tile using mobile services • Send.

Download Report

Transcript performance compatibility portability 1. 2. 3. 4. Performance Compatibility Portability Productivity Connected Windows Store Apps Visual Studio 2013 makes it easier to: • Update your app tile using mobile services • Send.

performance
compatibility
portability
1.
2.
3.
4.
Performance
Compatibility
Portability
Productivity
Connected Windows Store Apps
Visual Studio 2013 makes it easier to:
• Update your app tile using mobile services
• Send push notifications to your Windows Store app
• Accessing Azure mobile services backend capabilities
How?
• New C++ library for Azure mobile services
• Integrated VS tools
Better XAML Designer
New and updated templates
Improved XAML editor
Rulers and dynamic guides
New Windows 8.1 controls
Improved Designer performance
Better in-place style and template editing
Powerful Graphics Debugging
VS2012 introduced DirectX-based Graphics debugging tools in VS Professional,
Premium and Ultimate
VS2013 adds:
• Support in VS Express
• Capturing frames from
remote machines
• Compute shader
debugging
• Faster frame capture
Deeper Diagnostics
Diagnostics hub
•
•
•
XAML UI responsiveness profiling
Energy profiler
CPU profiling
Better WinRT Exception debugging
‘Just My Code’ debugging
Improved Async debugging
JavaScript/C++ interop debugging
C#/C++ interop debugging *
ARM dump debugging *
C++/CX
• Boxed types in WinRT structs
value struct Person {
IBox<int>^ Age;
}
• Overriding ToString()
ref struct Person {
public:
String^ Name;
virtual String^ ToString() override
{ return Name; }
}
• Improved WinRT exceptions
• Retains stack trace and message string
across the ABI
• Developers can specify custom message
strings
• Faster performance
• Ref classes instantiate faster, have more
compact layouts in memory
• Boxing and factory caching improved to
speed up XAML scenarios
• Facilitated inlining and other code
optimizations
0.
Windows 8.1 Tools
2.
3.
4.
Compatibility
Portability
Productivity
Performance Optimizations Recap
Compilation Unit Optimizations
• /O2 and friends
Profile-Guided Optimizations
• /LTCG:PGI and /LTCG:PGO
Whole Program Optimizations
• /GL and /LTCG
Automatic Vectorization
VS 2012:
•
VS 2013 adds:
Uses “vector” instructions where possible in
loops
•
Statement level vectorization
•
Permutation of perfect loop nests
•
Range propagation optimizations
•
Support for more operations: min/max,
converts, shifts, byteswap, averaging
•
Reductions into array elements
•
__restrict support for vector alias checking
v1 v2
•
Improvements to data dependence analysis
+
+
•
C++ pointer vectorization
r3
v3
•
Gather / scatter optimizations
for (i = 0; i < 1000; i++) {
A[i] = B[i] + C[i];
}
SCALAR
(1 operation)
r2
r1
add r3, r1, r2
VECTOR
(N operations)
vector
length
vadd v3, v1, v2
Automatic Vectorization
// STL – pointers everywhere; not even a loop counter variable
void transform1(const int * first1, const int * last1, const int * first2, int * result) {
while (first1 != last1) {
//converted to integer
*result++ = *first1++ + *first2++;
// make these array references
}
}
// DirectX – no loops here! Vectorize operations on adjacent memory cells
void four_vector_example(XMVECTOR V) {
XMVECTOR Result;
Result.vector4_f32[0] = 1.f / V.vector4_f32[0];
Result.vector4_f32[1] = 1.f / V.vector4_f32[1];
Result.vector4_f32[2] = 1.f / V.vector4_f32[2];
Result.vector4_f32[3] = 1.f / V.vector4_f32[3];
return Result;
}
// Machine Vision Library
void machine_vision_filter_example (int *A, int boxStart) {
for (int i = 0; i < 100; i++)
A[boxStart + i] = A[boxStart + i] + 1;
}
Vector Calling Convention
struct Particle {
__m256 x;
__m256 y;
__m256 z;
__m256 w;
};
Particle __vectorcall foo(Particle a, __m256 scale)
{
Particle t;
t.x
t.y
t.z
t.w
=
=
=
=
_mm256_mul_ps(a.x,
_mm256_mul_ps(a.y,
_mm256_mul_ps(a.z,
_mm256_mul_ps(a.w,
return t;
}
scale);
scale);
scale);
scale);
Reduces instruction count
Minimizes stack allocation
Use /Gv for whole module
C++ AMP
In VS2012:
• Programming model for heterogeneous computing
• Allowed C++ code to run on the GPU for general-purpose computation
• STL-like library for multidimensional data
VS2013 adds:
•
•
•
•
•
•
•
Shared memory support to eliminate/reduce copying of data between CPU and GPU
Enhanced texture support: texture sampling, mipmap support and staging textures
C++ AMP debugging on Win7 and side-by-side CPU/GPU debugging
Faster C++ AMP runtime: improved copy performance, reduce launch overhead
Better DirectX interop support
Improved C++ AMP runtime diagnostics
Improvements to array_view APIs
0.
1.
Windows 8.1 Tools
Performance
3.
4.
Portability
Productivity
C++11
We have a lot here …
see Herb’s talk on Friday at noon.
0.
1.
2.
Windows 8.1 Tools
Performance
Compatibility
4.
Productivity
C++ REST SDK
Cloud-based client-server communications library for C++
Basics:
• Connecting and interacting with RESTful services
• Uncompromised performance and productivity
• Asynchrony for responsiveness and scalability
• Uses modern C++11 patterns
• Cross-platform enabled and OSS
C++ REST SDK
HTTP Client to send requests and handle responses
JSON library for constructing, parsing and serializing JSON
objects.
Asynchronous Streams and Stream Buffers for reading/writing
bytes to/from an underlying medium.
http://casablanca.codeplex.com
Basic HTTP Client
http_client client(L"http://www.myhttpserver.com");
http_request request(methods::GET);
client.request(request).then([](http_response response)
{
// Perform actions here to inspect the HTTP response...
if(response.status_code() == status_codes::OK)
{
}
});
Make an HTTP request to get a JSON value
void RequestJSONValue()
{
http_client client(L"http://www.myhttpserver.com");
client.request(methods::GET).then([](http_response response)
{
if(response.status_code() == status_codes::OK)
{
return response.extract_json();
}
// Handle error cases, for now return null json value...
return task_from_result(json::value());
})
.then([](json::value v)
{
// Perform actions here to process the JSON value...
});
}
0.
1.
2.
3.
Windows 8.1 Tools
Performance
Compatibility
Portability
NuGet
Easy acquisition and usage
of compatible libraries in
C++ projects
Library vendors can expose
their libraries as NuGet
packages using available
tools
http://blogs.msdn.com/b/vcblog/archive/2013/04/26/nuget-for-c.aspx
Code Formatting
Configurable options for
indentation, space, new lines
and wrapping
Automatically applied while
typing, pasting or formatting
Header / Code Switching
Brace Completion
Code Peek
View type definitions without leaving the current open file
Code Analysis UI Enhancements
Filter on categories and sort on
various fields to help focus on
important problems first
Async Debugging
Supports Windows Store and Desktop apps
Requires Windows 8.1
Enhancements to the Call Stack and Tasks window
Answers the questions “Why am I here?” & “What is going on right now?”
“Just My Code” debugging
Helps developer focus on code they authored
Call Stack window hides non-user code
Non-user code defined in configurable .natjmc file
Not used during stepping
Interop debugging
Multiple flavors of interop
debugging enabled:
•
•
•
•
JavaScript / C++
C# / VB / C++
CPython / C++
GPU / CPU
Enable by choosing an option in the Project Properties
Break in the debugger in either C++ or JS/C#/VB/Python code
• Breakpoint | Exception | Break All (pause icon)
Inspect state, e.g. in Locals, Call Stack
http://blogs.msdn.com/vcblog
http://msdn.microsoft.com/en-us/visualc/default.aspx
Thu 11:30am 3-141
Fri 10:30am 4-329
Fri 12:00pm
DirectX Graphics Debugging Tools
Native Code Performance and Memory: The Elephant in the CPU
2-211
Windows Phone: Using Native (C++) Code in Your Apps
2-306
The Future of C++
3-308
C++/CX Best Practices
Give
Give us
us your
your feedback!
What?
When & Where?
Why?
• Are you interested in
having an impact on
the future user
experiences in Visual
Studio? Come help
us shape the future.
• Schedule a time with
us
[email protected]
• Your input and
feedback will
influence future
Microsoft Visual
Studio tools
• Room 254 South
Moscone, West
Mezzanine Level