Performance is a feature! - Developer South Coast - part 2

Performance is a Feature!
Why does performance matter?
What do we need to measure?
How we can fix the issues?
Front-end
Database & Caching
.NET CLR
Mechanical
Sympathy
How?
Measure, measure, measure
1. Identify bottlenecks
2. Know the optimisation works
How?
“The simple act of putting a render time in the upper right hand corner of every
page we serve forced us to fix all our performance regressions and omissions.”
How?
https://github.com/opserver/Opserver
How?
https://github.com/opserver/Opserver
How?
The Art of Benchmarking
Profiling -> Micro-benchmarks
static void Profile(int iterations, Action action)
{
action(); // warm up
GC.Collect(); // clean up
var watch = new Stopwatch();
watch.Start();
for (int i = 0; i < iterations; i++)
{
action();
}
watch.Stop();
Console.WriteLine("Time Elapsed {0} ms",
watch.ElapsedMilliseconds);
}
http://stackoverflow.com/questions/1047218/benchmarking-small-
code-samples-in-c-can-this-implementation-be-improved
private static T Result;
static void Profile<T>(int iterations, Func<T> func)
{
func(); // warm up
GC.Collect(); // clean up
var watch = new Stopwatch();
watch.Start();
for (int i = 0; i < iterations; i++)
{
Result = func();
}
watch.Stop();
Console.WriteLine("Time Elapsed {0} ms",
watch.ElapsedMilliseconds);
}
BenchmarkDotNet
BenchmarkDotNet Demo
How?
Garbage Collection (GC)
Allocations are cheap, but cleaning up isn’t
Difficult to measure the impact of GC
http://www.slideshare.net/benemmett/net-memory-management-ndc-london
https://vimeo.com/113632451
Performance is a feature!  - Developer South Coast - part 2
Performance is a feature!  - Developer South Coast - part 2
Stack Overflow Performance Lessons
Performance is a feature!  - Developer South Coast - part 2
Stack Overflow Performance Lessons
Use static classes
Don’t be afraid to write your own tools
Dapper, Jil, MiniProfiler,
Intimately know your platform - CLR
Performance is a feature!  - Developer South Coast - part 2
Roslyn Performance Lessons 1
public class Logger
{
public static void WriteLine(string s) { /*...*/ }
}
public class BoxingExample
{
public void Log(int id, int size)
{
var s = string.Format("{0}:{1}", id, size);
Logger.WriteLine(s);
}
}
Essential Truths Everyone Should Know about Performance in a Large Managed Codebase
Roslyn Performance Lessons 1
public class Logger
{
public static void WriteLine(string s) { /*...*/ }
}
public class BoxingExample
{
public void Log(int id, int size)
{
var s = string.Format("{0}:{1}",
id.ToString(), size.ToString());
Logger.WriteLine(s);
}
}
AVOID BOXING
Roslyn Performance Lessons 2
class Symbol {
public string Name { get; private set; }
/*...*/
}
class Compiler {
private List<Symbol> symbols;
public Symbol FindMatchingSymbol(string name)
{
return symbols.FirstOrDefault(s => s.Name == name);
}
}
Roslyn Performance Lessons 2
class Symbol {
public string Name { get; private set; }
/*...*/
}
class Compiler {
private List<Symbol> symbols;
public Symbol FindMatchingSymbol(string name)
{
foreach (Symbol s in symbols)
{
if (s.Name == name)
return s;
}
return null;
}
}
DON’T USE LINQ
Roslyn Performance Lessons 3
public class Example
{
// Constructs a name like "Foo<T1, T2, T3>"
public string GenerateFullTypeName(string name, int arity)
{
StringBuilder sb = new StringBuilder();
sb.Append(name);
if (arity != 0)
{
sb.Append("<");
for (int i = 1; i < arity; i++)
{
sb.Append('T'); sb.Append(i.ToString());
}
sb.Append('T'); sb.Append(arity.ToString());
}
return sb.ToString();
}
}
Roslyn Performance Lessons 3
public class Example
{
// Constructs a name like "Foo<T1, T2, T3>"
public string GenerateFullTypeName(string name, int arity)
{
StringBuilder sb = new AcquireBuilder();
sb.Append(name);
if (arity != 0)
{
sb.Append("<");
for (int i = 1; i < arity; i++)
{
sb.Append('T'); sb.Append(i.ToString());
}
sb.Append('T'); sb.Append(arity.ToString());
}
return GetStringAndReleaseBuilder(sb);
}
}
OBJECT POOLING
Roslyn Performance Lessons 3
[ThreadStatic]
private static StringBuilder cachedStringBuilder;
private static StringBuilder AcquireBuilder()
{
StringBuilder result = cachedStringBuilder;
if (result == null)
{
return new StringBuilder();
}
result.Clear();
cachedStringBuilder = null;
return result;
}
private static string GetStringAndReleaseBuilder(StringBuilder sb)
{
string result = sb.ToString();
cachedStringBuilder = sb;
return result;
}
Roslyn Performance Lessons Demo
Resources
Questions?
@matthewwarren
www.mattwarren.org
1 of 29

Recommended

Performance is a feature! - London .NET User Group by
Performance is a feature! - London .NET User GroupPerformance is a feature! - London .NET User Group
Performance is a feature! - London .NET User GroupMatt Warren
100.3K views45 slides
From 'dotnet run' to 'hello world' by
From 'dotnet run' to 'hello world'From 'dotnet run' to 'hello world'
From 'dotnet run' to 'hello world'Matt Warren
86.3K views40 slides
DevoxxPL: JRebel Under The Covers by
DevoxxPL: JRebel Under The CoversDevoxxPL: JRebel Under The Covers
DevoxxPL: JRebel Under The CoversSimon Maple
1.2K views54 slides
Embedded systems by
Embedded systems Embedded systems
Embedded systems Katy Anton
750 views50 slides
Is your profiler speaking the same language as you? -- Docklands JUG by
Is your profiler speaking the same language as you? -- Docklands JUGIs your profiler speaking the same language as you? -- Docklands JUG
Is your profiler speaking the same language as you? -- Docklands JUGSimon Maple
563 views47 slides
All you need to know about the JavaScript event loop by
All you need to know about the JavaScript event loopAll you need to know about the JavaScript event loop
All you need to know about the JavaScript event loopSaša Tatar
981 views15 slides

More Related Content

What's hot

Functional Reactive Programming with RxJS by
Functional Reactive Programming with RxJSFunctional Reactive Programming with RxJS
Functional Reactive Programming with RxJSstefanmayer13
40.4K views39 slides
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ... by
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...Anne Nicolas
2.2K views55 slides
Linux kernel tracing superpowers in the cloud by
Linux kernel tracing superpowers in the cloudLinux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloudAndrea Righi
400 views36 slides
Functional Reactive Programming / Compositional Event Systems by
Functional Reactive Programming / Compositional Event SystemsFunctional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event SystemsLeonardo Borges
18K views72 slides
Java gpu computing by
Java gpu computingJava gpu computing
Java gpu computingArjan Lamers
579 views31 slides
How to write memory efficient code? by
How to write memory efficient code?How to write memory efficient code?
How to write memory efficient code?Tier1 app
709 views28 slides

What's hot(20)

Functional Reactive Programming with RxJS by stefanmayer13
Functional Reactive Programming with RxJSFunctional Reactive Programming with RxJS
Functional Reactive Programming with RxJS
stefanmayer1340.4K views
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ... by Anne Nicolas
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
Anne Nicolas2.2K views
Linux kernel tracing superpowers in the cloud by Andrea Righi
Linux kernel tracing superpowers in the cloudLinux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloud
Andrea Righi400 views
Functional Reactive Programming / Compositional Event Systems by Leonardo Borges
Functional Reactive Programming / Compositional Event SystemsFunctional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event Systems
Leonardo Borges18K views
How to write memory efficient code? by Tier1 app
How to write memory efficient code?How to write memory efficient code?
How to write memory efficient code?
Tier1 app709 views
New Ways to Find Latency in Linux Using Tracing by ScyllaDB
New Ways to Find Latency in Linux Using TracingNew Ways to Find Latency in Linux Using Tracing
New Ways to Find Latency in Linux Using Tracing
ScyllaDB2.3K views
Hibernate Import.Sql I18n by yifi2009
Hibernate Import.Sql I18nHibernate Import.Sql I18n
Hibernate Import.Sql I18n
yifi2009819 views
Don't dump thread dumps by Tier1 App
Don't dump thread dumpsDon't dump thread dumps
Don't dump thread dumps
Tier1 App1.2K views
Binary Studio Academy: Concurrency in C# 5.0 by Binary Studio
Binary Studio Academy: Concurrency in C# 5.0Binary Studio Academy: Concurrency in C# 5.0
Binary Studio Academy: Concurrency in C# 5.0
Binary Studio273 views
Testing Zen by day
Testing ZenTesting Zen
Testing Zen
day961 views
How & why-memory-efficient? by Tier1 app
How & why-memory-efficient?How & why-memory-efficient?
How & why-memory-efficient?
Tier1 app253 views
Rails Hardware (no conclusions!) by yarry
Rails Hardware (no conclusions!)Rails Hardware (no conclusions!)
Rails Hardware (no conclusions!)
yarry257 views
Adding replication protocol support for psycopg2 by Alexander Shulgin
Adding replication protocol support for psycopg2Adding replication protocol support for psycopg2
Adding replication protocol support for psycopg2
Alexander Shulgin724 views
TestR: generating unit tests for R internals by Roman Tsegelskyi
TestR: generating unit tests for R internalsTestR: generating unit tests for R internals
TestR: generating unit tests for R internals
Roman Tsegelskyi2.2K views
Adopting GraalVM - Scala eXchange London 2018 by Petr Zapletal
Adopting GraalVM - Scala eXchange London 2018Adopting GraalVM - Scala eXchange London 2018
Adopting GraalVM - Scala eXchange London 2018
Petr Zapletal579 views

Similar to Performance is a feature! - Developer South Coast - part 2

Performance is a Feature! by
Performance is a Feature!Performance is a Feature!
Performance is a Feature!PostSharp Technologies
835 views53 slides
JavaScript 2016 for C# Developers by
JavaScript 2016 for C# DevelopersJavaScript 2016 for C# Developers
JavaScript 2016 for C# DevelopersRick Beerendonk
563 views50 slides
MiamiJS - The Future of JavaScript by
MiamiJS - The Future of JavaScriptMiamiJS - The Future of JavaScript
MiamiJS - The Future of JavaScriptCaridy Patino
761 views50 slides
Typescript barcelona by
Typescript barcelonaTypescript barcelona
Typescript barcelonaChristoffer Noring
660 views36 slides
JavaScript in 2016 by
JavaScript in 2016JavaScript in 2016
JavaScript in 2016Codemotion
636 views65 slides
JavaScript in 2016 (Codemotion Rome) by
JavaScript in 2016 (Codemotion Rome)JavaScript in 2016 (Codemotion Rome)
JavaScript in 2016 (Codemotion Rome)Eduard Tomàs
1.2K views65 slides

Similar to Performance is a feature! - Developer South Coast - part 2(20)

JavaScript 2016 for C# Developers by Rick Beerendonk
JavaScript 2016 for C# DevelopersJavaScript 2016 for C# Developers
JavaScript 2016 for C# Developers
Rick Beerendonk563 views
MiamiJS - The Future of JavaScript by Caridy Patino
MiamiJS - The Future of JavaScriptMiamiJS - The Future of JavaScript
MiamiJS - The Future of JavaScript
Caridy Patino761 views
JavaScript in 2016 by Codemotion
JavaScript in 2016JavaScript in 2016
JavaScript in 2016
Codemotion636 views
JavaScript in 2016 (Codemotion Rome) by Eduard Tomàs
JavaScript in 2016 (Codemotion Rome)JavaScript in 2016 (Codemotion Rome)
JavaScript in 2016 (Codemotion Rome)
Eduard Tomàs1.2K views
Performance is a Feature! at DDD 11 by Matt Warren
Performance is a Feature! at DDD 11Performance is a Feature! at DDD 11
Performance is a Feature! at DDD 11
Matt Warren1.7K views
Session three Builders & developers workshop Microsoft Tech Club 2015 by Moatasim Magdy
Session three Builders & developers workshop Microsoft Tech Club 2015Session three Builders & developers workshop Microsoft Tech Club 2015
Session three Builders & developers workshop Microsoft Tech Club 2015
Moatasim Magdy554 views
20.1 Java working with abstraction by Intro C# Book
20.1 Java working with abstraction20.1 Java working with abstraction
20.1 Java working with abstraction
Intro C# Book8.1K views
Ecmascript 2015 – best of new features() by Miłosz Sobczak
Ecmascript 2015 – best of new features()Ecmascript 2015 – best of new features()
Ecmascript 2015 – best of new features()
Miłosz Sobczak863 views
JavaScript Growing Up by David Padbury
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
David Padbury14.1K views
ECMAScript.Next ECMAScipt 6 by Kevin DeRudder
ECMAScript.Next ECMAScipt 6ECMAScript.Next ECMAScipt 6
ECMAScript.Next ECMAScipt 6
Kevin DeRudder4.3K views
PyCon 2010 SQLAlchemy tutorial by jbellis
PyCon 2010 SQLAlchemy tutorialPyCon 2010 SQLAlchemy tutorial
PyCon 2010 SQLAlchemy tutorial
jbellis5.4K views
Roslyn: el futuro de C# y VB.NET by Rodolfo Finochietti by .NET Conf UY
Roslyn: el futuro de C# y VB.NET by Rodolfo FinochiettiRoslyn: el futuro de C# y VB.NET by Rodolfo Finochietti
Roslyn: el futuro de C# y VB.NET by Rodolfo Finochietti
.NET Conf UY896 views
Fast Web Applications Development with Ruby on Rails on Oracle by Raimonds Simanovskis
Fast Web Applications Development with Ruby on Rails on OracleFast Web Applications Development with Ruby on Rails on Oracle
Fast Web Applications Development with Ruby on Rails on Oracle
BigQuery JavaScript User-Defined Functions by THOMAS PARK and FELIPE HOFFA at... by Big Data Spain
BigQuery JavaScript User-Defined Functions by THOMAS PARK and FELIPE HOFFA at...BigQuery JavaScript User-Defined Functions by THOMAS PARK and FELIPE HOFFA at...
BigQuery JavaScript User-Defined Functions by THOMAS PARK and FELIPE HOFFA at...
Big Data Spain6.7K views
ECMAScript2015 by qmmr
ECMAScript2015ECMAScript2015
ECMAScript2015
qmmr217 views

Recently uploaded

Microsoft Power Platform.pptx by
Microsoft Power Platform.pptxMicrosoft Power Platform.pptx
Microsoft Power Platform.pptxUni Systems S.M.S.A.
52 views38 slides
Empathic Computing: Delivering the Potential of the Metaverse by
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the MetaverseMark Billinghurst
476 views80 slides
Tunable Laser (1).pptx by
Tunable Laser (1).pptxTunable Laser (1).pptx
Tunable Laser (1).pptxHajira Mahmood
24 views37 slides
Uni Systems for Power Platform.pptx by
Uni Systems for Power Platform.pptxUni Systems for Power Platform.pptx
Uni Systems for Power Platform.pptxUni Systems S.M.S.A.
55 views21 slides
Design Driven Network Assurance by
Design Driven Network AssuranceDesign Driven Network Assurance
Design Driven Network AssuranceNetwork Automation Forum
15 views42 slides
HTTP headers that make your website go faster - devs.gent November 2023 by
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023Thijs Feryn
21 views151 slides

Recently uploaded(20)

Empathic Computing: Delivering the Potential of the Metaverse by Mark Billinghurst
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the Metaverse
Mark Billinghurst476 views
HTTP headers that make your website go faster - devs.gent November 2023 by Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn21 views
SAP Automation Using Bar Code and FIORI.pdf by Virendra Rai, PMP
SAP Automation Using Bar Code and FIORI.pdfSAP Automation Using Bar Code and FIORI.pdf
SAP Automation Using Bar Code and FIORI.pdf
Data Integrity for Banking and Financial Services by Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely12 views
PharoJS - Zürich Smalltalk Group Meetup November 2023 by Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi126 views
Case Study Copenhagen Energy and Business Central.pdf by Aitana
Case Study Copenhagen Energy and Business Central.pdfCase Study Copenhagen Energy and Business Central.pdf
Case Study Copenhagen Energy and Business Central.pdf
Aitana16 views
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... by Jasper Oosterveld
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
Serverless computing with Google Cloud (2023-24) by wesley chun
Serverless computing with Google Cloud (2023-24)Serverless computing with Google Cloud (2023-24)
Serverless computing with Google Cloud (2023-24)
wesley chun10 views
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive

Performance is a feature! - Developer South Coast - part 2

  • 1. Performance is a Feature!
  • 2. Why does performance matter? What do we need to measure? How we can fix the issues?
  • 3. Front-end Database & Caching .NET CLR Mechanical Sympathy
  • 4. How? Measure, measure, measure 1. Identify bottlenecks 2. Know the optimisation works
  • 5. How? “The simple act of putting a render time in the upper right hand corner of every page we serve forced us to fix all our performance regressions and omissions.”
  • 8. How? The Art of Benchmarking Profiling -> Micro-benchmarks
  • 9. static void Profile(int iterations, Action action) { action(); // warm up GC.Collect(); // clean up var watch = new Stopwatch(); watch.Start(); for (int i = 0; i < iterations; i++) { action(); } watch.Stop(); Console.WriteLine("Time Elapsed {0} ms", watch.ElapsedMilliseconds); } http://stackoverflow.com/questions/1047218/benchmarking-small- code-samples-in-c-can-this-implementation-be-improved
  • 10. private static T Result; static void Profile<T>(int iterations, Func<T> func) { func(); // warm up GC.Collect(); // clean up var watch = new Stopwatch(); watch.Start(); for (int i = 0; i < iterations; i++) { Result = func(); } watch.Stop(); Console.WriteLine("Time Elapsed {0} ms", watch.ElapsedMilliseconds); }
  • 13. How? Garbage Collection (GC) Allocations are cheap, but cleaning up isn’t Difficult to measure the impact of GC http://www.slideshare.net/benemmett/net-memory-management-ndc-london https://vimeo.com/113632451
  • 18. Stack Overflow Performance Lessons Use static classes Don’t be afraid to write your own tools Dapper, Jil, MiniProfiler, Intimately know your platform - CLR
  • 20. Roslyn Performance Lessons 1 public class Logger { public static void WriteLine(string s) { /*...*/ } } public class BoxingExample { public void Log(int id, int size) { var s = string.Format("{0}:{1}", id, size); Logger.WriteLine(s); } } Essential Truths Everyone Should Know about Performance in a Large Managed Codebase
  • 21. Roslyn Performance Lessons 1 public class Logger { public static void WriteLine(string s) { /*...*/ } } public class BoxingExample { public void Log(int id, int size) { var s = string.Format("{0}:{1}", id.ToString(), size.ToString()); Logger.WriteLine(s); } } AVOID BOXING
  • 22. Roslyn Performance Lessons 2 class Symbol { public string Name { get; private set; } /*...*/ } class Compiler { private List<Symbol> symbols; public Symbol FindMatchingSymbol(string name) { return symbols.FirstOrDefault(s => s.Name == name); } }
  • 23. Roslyn Performance Lessons 2 class Symbol { public string Name { get; private set; } /*...*/ } class Compiler { private List<Symbol> symbols; public Symbol FindMatchingSymbol(string name) { foreach (Symbol s in symbols) { if (s.Name == name) return s; } return null; } } DON’T USE LINQ
  • 24. Roslyn Performance Lessons 3 public class Example { // Constructs a name like "Foo<T1, T2, T3>" public string GenerateFullTypeName(string name, int arity) { StringBuilder sb = new StringBuilder(); sb.Append(name); if (arity != 0) { sb.Append("<"); for (int i = 1; i < arity; i++) { sb.Append('T'); sb.Append(i.ToString()); } sb.Append('T'); sb.Append(arity.ToString()); } return sb.ToString(); } }
  • 25. Roslyn Performance Lessons 3 public class Example { // Constructs a name like "Foo<T1, T2, T3>" public string GenerateFullTypeName(string name, int arity) { StringBuilder sb = new AcquireBuilder(); sb.Append(name); if (arity != 0) { sb.Append("<"); for (int i = 1; i < arity; i++) { sb.Append('T'); sb.Append(i.ToString()); } sb.Append('T'); sb.Append(arity.ToString()); } return GetStringAndReleaseBuilder(sb); } } OBJECT POOLING
  • 26. Roslyn Performance Lessons 3 [ThreadStatic] private static StringBuilder cachedStringBuilder; private static StringBuilder AcquireBuilder() { StringBuilder result = cachedStringBuilder; if (result == null) { return new StringBuilder(); } result.Clear(); cachedStringBuilder = null; return result; } private static string GetStringAndReleaseBuilder(StringBuilder sb) { string result = sb.ToString(); cachedStringBuilder = sb; return result; }

Editor's Notes

  1. Who has:      - any perf requirements     - perf requirements with numbers!     - any perf tests     - perf test that are run continuously
  2. Front-end - YSlow, Google PageSpeed, CDN & caching    - "High Performance Web Sites" by Steve Sounder Database & caching - Learn to use SQL Profiler  - Redis or similar - MiniProfiler .NET (server-side) <- This is what we are looking at Mechanical Sympathy - Anything by Martin Thompson - Disruptor and Disruptor.NET  - CPU caches (L1, L2, etc) - memory access patterns
  3. You’ll probably guess wrong!! Consider adding performance unit tests, Noda-Time does this, can graph performance over time, see if it’s regressed!!
  4. MiniProfiler Turn this on in Development and if possible in Production Glimpse is an alternative
  5. Runs on .NET, Puts everything in 1 place, Web Server & Database Summary metrics up front Can drill-down into detailed metrics, including executed SQL, page load times, etc
  6. Make sure you are really measuring what you think you are measuring!!
  7. Warm up – For the JITter Get GC out of the way Lots of iterations Use Stopwatch, NOT DateTime.Now Have to be weary of the JITter
  8. JITter will remove functions call if the return value isn’t used (sometimes) Still not perfect, loop overhead can dominate!!! So unr POSSIBLE DEMO (if time)
  9. Make sure you are really measuring what you think you are measuring!!
  10. Make sure you are really measuring what you think you are measuring!!
  11. Both StackOverflow and Roslyn affected by this!!!!! In the .NET Framework 4.5, there is background server garbage collection (before .NET 4.5 was Workstation only) So until .NET 4.5, Server GC was STOP-THE-WORLD In .NET 4.6 there is now TryStartNoGCRegion and EndNoGCRegion
  12. Process Explorer From Sysinternals
  13. PerfView is a stand-alone utility, to help you debug CPU and memory problems Light-weight and non-intrusive, can be used to on production apps with minimal impact Uses ETW (Event Tracing for Windows), designed to be v. fast!!!!
  14. Just and intro Don’t need to say anything else here!
  15. They were able to graph these results & equate them to Garbage Collector pauses!!! They had good logging and measurements in place,
  16. Ask "Any questions so far?” At this point should be ~45 minutes in Not long left!!!
  17. They measured and found that all of these were on the HOT PATH
  18. Repeat questions back to the audience!!!!!