We got 99 problems and a glitch is one

zajkowskimarcin

mzajkowski

callumbwhyte

callumbwhyte

D.W.A.

Devz Wit Attitudes

Our outsourced homie

#viral

X-Factor Effect™

BE
20%

FE
80%

Tracklist for today

  • Because I Got High (feat. Common Pitfalls)
  • Cache, Money, SEOs
  • Get Low (feat. Lil GC Pressure)
  • The Notorius C.P.U. (Spike's Tribute)
  • Big Poppa a.k.a. Size Matters (feat. BenchmarkDotNet)
  • When I'm Gone

Always measure.

Before

After

There are only two hard things in Computer Science: cache invalidation and naming things. 

Phil Karlton

Umbraco performance gotchas

  • Examine Indexes
  • Media
  • Database hits
  • Singletons
  • Static Umbraco Context(s)
  • Events (lot of Events...)

Get Low!

Common performance drains

  • (The Notorious) C.P.U Spikes:
    • contentions (async calls!)
    • algorithms (e.g. hashing)
    • I/O
    • parsing (hi JSON!)
    • more...
  • GC / Memory Pressure
    • data structures
    • allocations
    • compiler gotchas

.ToList()

Class vs Struct

What is a Stack?
What is a Heap? 

Stack is a place in the memory where value types are stored.

Heap is a place in the memory where the reference types are stored.

Value Types

  • Int, Float, Short, Long...
  • Byte
  • Structs
  • Enums
  • Bool

Reference Types

  • Class
  • Interface
  • Array
  • String
  • Delegate
  • Tuple...

The great Eric Lippert once wrote 'The Stack Is An Implementation Detail' and basically that's not true anymore.

Jon Skeet

Think before the execution.

And after too

.ToString() or not .ToString(), that's the question...

JIT up, stand up!

a.k.a. compiler gotchas

params[]

Span<T>

ref & in

It's just the beginning...

Helpful tools & references

For the real hardcore playazz: WinDbg, SOS, PerfView and more!

Marcin Zajkowski & Callum Whyte

Senior Devs & Umbraco MVPs @ The Cogworks

#umbraCoffee Baristas @ YouTube (Friday's 12:30 on YT)

zajkowskimarcin

mzajkowski

callumbwhyte

callumbwhyte

#cg18

#99problems

Thank you!