//build/ 2014 Day 2 session recap

I have attended live the sessions described below on day 2 at the Build conference and these are my notes from these sessions. Some parts might not be easily readable or understandable (even for me Smile )  because the sessions were fast-paced and I tried to write down everything which seemed important to me. Nevertheless I hope that this brief summary is helpful to some of you.

The Present and Future of .NET in a World of Devices and Services

  • Present
    • 1.8 million .Net installations
    • 6 million .Net developers
  • Present and future goals
    • .Net Innovation
    • Flexibility and agility (Nuget)
    • Openness (OSS)
  • .Net Runtime
  • Styling Code extension with code fix suggestion
  • Reference Source: navigate in the .Net framework source code inside the browser
  • .Net Foundation: OSS around .Net
  • .Net in the cloud
  • .Net in Windows Store devices
    • Universal Windows apps shared across Windows 8.1 and Windows Phone 8.1
  • .Net Native
    • Native code compilation
    • Running on C++ compiler
    • C# => IL => C++
    • Preview available as Visual Studio 2013 add-in
    • Currently only for store apps, x64 and ARM
  • Web API: Azure Mobile Service project template
    • e.g. Twilio

DirectX Graphics Development with Visual Studio 2013

  • Why DirectX?
    • Gaming
    • 3D rendering
  • Built with DirectX: Halo: Spartan Assault, Bing Maps, Fresh Paint (XAML controls, DX rendering), Project Spark
  • Tools in Visual Studio 2013
    • Project template, Item template, 3D Starter Kit, DX Toolkit
  • Visual Studio 2013 Update 2
    • Graphics Assets Authoring: Image Editor, Model Editor, Shader Designer
    • Graphics Diagnostics: Graphics Debugger, Graphics Profiler (Graphics Frame Analysis)
  • How to build DirectX app for Windows and Windows Phone
    • From scratch:
      • C++ Store Apps
        • DirectX
        • DirectX and XAML
      • Default solution contains Windows, Windows Phone and Shared projects
      • Sample project Cube has 100% sharable code
    • Existing app:
      • Make it universal
    • Universal project contains shared code
      • Platform-specific code with conditional code:
        • #if WINAPI_FAMILY != WINAPIFAMILY_PHONE_APP … #endif
  • Graphics Diagnostics
    • Visual Studio 2013 RTM
      • Remote debugging
      • Computer shader debugging (available in Visual Studio Express)
    • Visual Studio 2013 Update 2
      • Consecutive capture
      • Programmatic
      • Enhanced event list
      • Debug Windows Phone
    • Render issues
      • Debug => Graphics => Start Diagnostics (Alt+F5)
        • Starts app with Graphics Diagnostics attached
      • Capture frame: Frame to capture dropdown for consecutive frame capture, up to 30 frames
    • How to analyze frames
      • Look at Graphic Event Call Stack List tree view
      • Click on a pixel in Render Target window
      • Check triangles, colors
      • Graphics Pipeline Stages
      • Debug Pixel Shader
    • Debug in emulator and device
    • Average frame rate
      • Notebook: 60 FPS
      • Surface: 30 FPS
      • Windows Phone: 15 FPS
    • Performance problem when targeting low-end devices
      • Use Profiler
        • Capture everything
        • Use Frame Analysis
      • Run it on the device, collect hardware performance counter
      • Requires Windows Phone 8.1 for it to work (driver)
      • Check most expensive events
  • Visual Studio 3D Starter Kit
  • DirectX Toolkit: utility library

Go Mobile with C# and Xamarin

  • HTML for mobile apps is a terrible experience, constrained in features
  • Go fully native to take advantage of the platform instead of only a subset of features
    • Sensors, API
  • Create great user experience without limitations
  • C# runs on 2.6 millions of devices
    • Use async/await for great user experience
  • Reach every device that matters with C#
  • Architecting mobile apps
    • SILO approach
      • Build apps multiple times, one each for iOS, Android, Windows
      • Maintain 3 teams, 3 tools, several releases over multiple platforms
    • Write once, run anywhere approach
      • NO!
    • Xamarin approach
      • Native with code sharing across iOS, Android and Windows
      • Learn the new APIs and start using it!
        • Windows APIs
        • iOS APIs => strongly typed
        • Android APIs
      • Cannot JIT compile
      • How it works?
        • C# + .Net RT
        • Native UI
        • Native Performance
      • MonoTouch => iOS API
        • .Twitter
        • .CoreImage: image filter on GPU
      • C# shines over Objective C
        • Objective C => dictionary => maybe it won’t work
        • C# strongly typed => compiler, Intellisense
      • Xamarin project templates in Visual Studio
      • Strategies to share code over multiple platforms
        • BL
          • Universal apps
          • Shared
        • MVVM
      • Universal apps: reference in iOS and Android projects
      • Portable class library
        • Pure PCL
        • Advanced PCL
          • Reference assembly
          • Specific implementation for all platforms
          • Public contract
          • Nuget
      • New PCL project targets
        • Profile 78 (Microsoft)
          • No Silverlight 5
      • MailKit/MimeKit: best on the market
      • Run a C# app, get a C# shirt for free!
      • Component Store for 3rd party
        • e.g. Glass Development Kit for Google Glass
      • Xamarin Studio for development
      • Android form factor

The Next Generation of .NET for Building Applications

  • .Net 4.5.1 installed on 500+ millions of PCs
  • .Net Native announced
    • Offers performance of C++ with productivity of C#
    • Huge gain in performance for app startup and memory usage
    • Developer preview available today
    • New runtime
      • Lean and refactored
    • Compiler powered by same optimizing compiler backend as VS C++
    • V1 targeted at Store apps
    • Available for x64, ARM (x86 coming)
    • Examples: Wordament, Fresh Paint, Animal Planet, Discovery Channel
    • Visual Studio experience
      • Right click on the project => Enable for .Net Native
      • Project Properties => Build => Select Compile with .Net Native tool chain
    • At compile time: remove unused dependencies => IL => C++ => optimize => generate native machine code
    • Debug just like the C# code
    • Compiler in C++
    • Using optimized C++ backend
      • Vectorize and parallelize the app/code on one or more cores automatically
    • .Net Native on MSDN with FAQ and forum
    • Visual studio 2013 Update 2 RC required
  • New JIT compiler announced “RyuJIT” written from scratch for WPF and web apps
    • Dramatic performance improvements by just using RyuJIT, no code change needed
    • Available for x64 (more coming)
    • Innovation platform for optimizations
  • SIMD: Single Instruction Multiple Data
    • Enables data parallelization
    • Great for calculations
    • Same instruction works on multiple data
    • Faster code execution
    • Mandelbrot problem FlyThru sample
    • SISD: Single Instruction Single Data
      • Bad user experience for complex computations
    • From 26 seconds down to 5 seconds
    • Scalar => 4x scale SIMD (SSE2) => 8x scale SIMD (AVX)
    • SIMD usage:
      • From float[] to Vector<float>
    • SIMD CTP available, part of RyuJIT CTP 3
      • Current CTP includes support for SSE, support for AVS coming soon
    • Nuget package: Microsoft.Bcl.Simd
      • Includes vector APIs
  • Leverage same skillset for all platforms
    • Nuget packages cross-platform by default
    • “One Class Library”
      • Universal projects
      • Select one or more targets in Properties => Library => Targets
    • PCLs
      • Now available in Visual Studio 2013 Express for free
    • Cross-platform
      • Partnership with Xamarin
    • Microsoft on Nuget
      • 926 packages
      • 59 million downloads
    • .Net Foundation
    • Source Code as Documentation
      • Different approach to documentation
      • Openness
  • Feedback-driven
    • User Voice
    • Bug reports

You can find also lots of pictures from the conference and also some of the most important slides here on OneDrive.

Session recap for day 3 coming soon…

Useful links