We've crossed the 200+ download milestone, and I appreciate everyone who has contributed to this package.
@AkinpeluSegun @idam_okechukw @successJohn_ Paul Oke, @kenelight4u
We still have 6 issues to fix for release 1.0.2 https://t.co/6rdHD1gjla
@dustedcodes Not really
That line is a helper method that sets up hosting, config, logging, DI...
You can read about it on GitHub and see what it does. Most devs accept the defaults because they’re okay with it, not because they are clueless.
https://t.co/VIGY0pOiMd
.𝗡𝗘𝗧 𝟭𝟬 𝗮𝗻𝗱 𝘁𝗵𝗲 𝗲𝗻𝗱 𝗼𝗳 𝘁𝗵𝗲 “𝗮𝗯𝘀𝘁𝗿𝗮𝗰𝘁𝗶𝗼𝗻 𝘁𝗮𝘅”
High-level C# comes with a performance cost: interfaces and `foreach`. Lambdas. Helper methods. Cleaner code, small hit every time.
.NET 10 attacks those hits from many directions, and the wins stack up.
1️⃣ 𝗦𝘁𝗮𝗰𝗸 𝗮𝗹𝗹𝗼𝗰𝗮𝘁𝗶𝗼𝗻 𝗴𝗲𝘁𝘀 𝘀𝗺𝗮𝗿𝘁𝗲𝗿
The JIT’s escape analysis went deeper. It can follow objects through several layers of abstraction and see whether they leave the current method.
🔹 In a simple delegate benchmark, .NET 9 allocates 88 B per call (24 B closure + 64 B delegate).
🔹 In .NET 10, when the delegate never escapes, the delegate allocation disappears, and the benchmark drops to 24 B allocated.
🔹 Small arrays that stay inside a method can also move to the stack, and spans built from them benefit as well.
Result: less GC work, less allocation noise, same idiomatic C#.
2️⃣ 𝗔𝗿𝗿𝗮𝘆𝘀 𝗳𝗶𝗻𝗮𝗹𝗹𝘆 𝗱𝗲𝘃𝗶𝗿𝘁𝘂𝗮𝗹𝗶𝘇𝗲 𝘁𝗵𝗿𝗼𝘂𝗴𝗵 𝗶𝗻𝘁𝗲𝗿𝗳𝗮𝗰𝗲𝘀
Arrays implement `IList<T>`, but the JIT could not devirtualize those calls before.
That produced odd advice:
🔹 For `ReadOnlyCollection<T>` over an array, `foreach` with an enumerator could beat manual indexing.
🔹 Some LINQ paths that used `IList<T>[i]` turned into slower code in practice.
.NET 10 fixes this:
🔹 Array interface calls devirtualize.
🔹 `for` loops over array-backed collections speed up.
🔹 LINQ on arrays can see roughly 2–3× faster pipelines in microbenchmarks.
The old “foreach is faster than indexing here” guidance no longer holds.
3️⃣ 𝗕𝗼𝘂𝗻𝗱𝘀 𝗰𝗵𝗲𝗰𝗸𝘀 𝘂𝘀𝗲 𝗺𝗮𝘁𝗵 𝗶𝗻𝘀𝘁𝗲𝗮𝗱 𝗼𝗳 𝘀𝘂𝗽𝗲𝗿𝘀𝘁𝗶𝘁𝗶𝗼𝗻
The JIT now treats numeric ranges as hard facts.
🔹 `BitOperations.Log2(uint)` returns values in the 0–31 range. Indexing a 32-element lookup with that result loses its bounds check.
🔹 Range facts from conditions like `pos > 0 && pos <= span.Length - 42` hold regardless of condition order.
🔹 For sequential writes like `arr[0]` through `arr[7]`, the JIT clones the code:
➡️ Fast path: one upfront `Length >= 8` check, then writes with no bounds checks.
➡️ Slow path: per-write checks.
You write safe code, and the JIT emits code that looks closer to hand-written unsafe loops.
4️⃣ 𝗜𝗻𝗹𝗶𝗻𝗶𝗻𝗴 𝘂𝗻𝗯𝗹𝗼𝗰𝗸𝘀 𝗵𝗶𝗱𝗱𝗲𝗻 𝗵𝗼𝘁 𝗽𝗮𝘁𝗵𝘀
Inlining is the gateway optimization. Once a method inlines, other passes light up. .NET 10 removes several long-standing blockers:
🔹 Methods with `try/finally` can be inlined (every `foreach` loop has a hidden `try/finally`).
🔹 Callers of generic virtual methods can inline.
🔹 Empty exception handlers disappear when the `try` block cannot throw.
🔹 The inlining budget and locals limit both climb, so more complex methods qualify.
This drives greater virtualization, more robust range analysis, and more stack allocation.
Read the full text in the comments by Stephen Toub (4h read time, similar to ~200 pages book, w/o images).
Yesterday, I pushed my clean architecture template that includes implementations for EF, email (requires an API key from SendGrid or Mailgun), nLog, auth, authorization, email templates, and user functionality. It already has 30 unique clones!
@Tech_babby On LinkedIn web, after you filter to “Past 24hrs” check the URL: you’ll see something like r=86400. That’s seconds change it to a smaller value (eg r=60) to find jobs posted much more recently.