Sr. Content Developer at Microsoft, working remotely in PA, TechBash conference organizer, former Microsoft MVP, Husband, Dad and Geek.
160184 stories
·
33 followers

How an Atlanta Suburb Ended Up Sharing Flock Data With More Than 2,000 Organizations

1 Share
Alpharetta, Georgia, cops share data with thousands of Flock users, ranging from federal agencies to a fish and wildlife commission. The reasons why show how vast—and invasive—the network has become.
Read the whole story
alvinashcraft
just a second ago
reply
Pennsylvania, USA
Share this story
Delete

When you keep AI Lean, you keep AI correct

1 Share
Ryan chats with Leo de Moura, Senior Principal Applied Scientist at AWS and the creator of the Lean language, about proving correctness in AI agents with the Lean language, how automated reasoning complements probabilistic AI models, and the use of AI for continuous code optimization.
Read the whole story
alvinashcraft
36 seconds ago
reply
Pennsylvania, USA
Share this story
Delete

Episode 587: The Singularity Didn't Happen on the First

1 Share

This week, we discuss Stripe's singularity letter, its $8B Open Router buy, and AI job anxiety. Plus, Matt plays “Bot or Not” on another podcast.

Watch the YouTube Live Recording of Episode 587

Runner-up Titles

  • Inertia wins again
  • We don’t talk about the Pope very much.
  • Better than this year’s storage arrays
  • AI pimps its own ride
  • Chonking machine
  • A lot of chonk opportunity
  • I’m tired of tech people being all fancy
  • Thanksgiving with Ed Zitron
  • No religion, no politics, no AI
  • My recommendation: try harder
  • Teletubbies for Adults.

Rundown

Relevant to your Interests

Nonsense

Conferences

SDT News & Community

Recommendations

Sponsored By:





Download audio: https://aphid.fireside.fm/d/1437767933/9b74150b-3553-49dc-8332-f89bbbba9f92/c3740eae-682d-4c72-a87a-74532adb7827.mp3
Read the whole story
alvinashcraft
53 seconds ago
reply
Pennsylvania, USA
Share this story
Delete

Don't call it a comeback: HTML & Markdown in OneDrive and SharePoint

1 Share

HTML and Markdown are back in the spotlight, and AI is a big reason why. In this episode of Sync Up, hosts Stephen Rice and Arvind Mishra sit down with Dorine Rassaian (OneDrive Sr. Product Manager) and Nicole Woon (SharePoint Sr. Product Manager) to explore how AI-generated content is driving renewed interest in HTML and Markdown files across Microsoft 365.

Learn how organizations are using HTML dashboards, newsletters, reports, presentations, and interactive experiences generated with AI, and how OneDrive and SharePoint are evolving to make these files easier to view, edit, collaborate on, and share.

The conversation covers:

✅ Why HTML and Markdown are experiencing a resurgence

✅ How AI tools like Copilot generate HTML and Markdown content

✅ New OneDrive experiences for HTML and Markdown files

✅ WYSIWYG editing, inline text editing, and anchor comments

✅ Human-to-agent collaboration and the future of AI-powered work

✅ HTML-powered SharePoint pages and intranet experiences

✅ Real-world examples, dashboards, presentations, newsletters, and more

 

Whether you're a developer, IT professional, SharePoint administrator, or simply curious about how AI is changing the way we create and communicate, this episode offers a look at the future of content creation in Microsoft 365.

Guests

🎙️ Dorine Rassaian Senior Product Manager, OneDrive

🎙️ Nicole Woon Senior Product Manager, SharePoint

 

Resources

🔗 OneDrive Blog: https://aka.ms/OneDriveBlog

🔗 OneDrive Office Hours: https://aka.ms/OneDriveOfficeHours

🔗 Microsoft Podcasts: https://aka.ms/MicrosoftPodcasts





Download audio: https://traffic.libsyn.com/clean/secure/syncup/RP4520-0013_SyncUpPodcast-HTML_Pages_v4_082526.mp3?dest-id=1486229
Read the whole story
alvinashcraft
59 seconds ago
reply
Pennsylvania, USA
Share this story
Delete

Zonal redundancy in API management Standard v2

1 Share

APIs are the backbone of modern applications, powering everything from mobile experiences and microservices to AI-driven applications and business-critical integrations. As customers continue to modernize their platforms on Azure, they increasingly expect their API infrastructure to remain available even in the face of datacenter-level disruptions.

With zone redundancy in Standard v2, Azure API Management now enables customers to increase resilience against Availability Zone failures while continuing to benefit from the simplicity, performance, and cost efficiency of the v2 platform.

Why Zone Redundancy Matters

Azure Availability Zones are physically separate locations within an Azure region, each with independent power, cooling, and networking infrastructure. By distributing API Management resources across multiple zones, organizations can reduce the impact of a single datacenter failure and improve service continuity for their APIs. 

Until now, customers who required built-in zone-level resiliency often needed to evaluate higher-end deployment options. With this enhancement, Standard v2 customers can now deploy API gateways across Availability Zones and benefit from improved reliability while maintaining the streamlined operational model of the v2 platform.

What’s New

Zone Redundancy for Standard v2 extends the platform's resiliency by distributing service capacity across multiple Availability Zones within a supported Azure region.

Key benefits include:

  • Higher Availability: API traffic continues to flow even if a single Availability Zone experiences an outage.
  • Built-in Resiliency: Redundancy is provided at the platform layer, reducing the need for customers to design and manage complex intra-region failover solutions.
  • Production-Ready Reliability: Customers can confidently run critical API workloads on Standard v2 with stronger availability guarantees.
  • Operational Simplicity: The service automatically manages capacity distribution, health monitoring, and recovery behavior across zones.
  • Cost-Effective Resilience: Customers gain zone-level protection without requiring an enterprise-tier deployment model.

Built on the Modern v2 Platform

The v2 platform was designed from the ground up to provide a faster, more reliable, and more scalable API Management experience. Standard v2 already delivers capabilities such as rapid deployment, simplified networking, workspace support, and flexible scaling. Zone Redundancy further strengthens the platform by expanding its reliability story for production workloads. 

This announcement builds on our broader investment in making Azure API Management more accessible to a wider range of organizations, from digital-native startups to large enterprises modernizing their application estates.

Ideal Scenarios

Zone Redundancy in Standard v2 is particularly valuable for customers who:

  • Run business-critical APIs that must remain available during datacenter incidents.
  • Consolidate multiple application workloads behind a single API gateway.
  • Expose APIs consumed by mobile, partner, and customer-facing applications.
  • Support AI applications and agent-based architectures that depend on highly available API endpoints.

For organizations adopting modern cloud and AI native architectures, this capability helps ensure that API infrastructure remains aligned with broader application resiliency strategies.

A Foundation for Reliable AI and API Platforms

As AI-powered applications continue to proliferate, APIs increasingly become the critical connection layer between models, agents, business systems, and data platforms. Downtime at the API layer can have a direct impact on application availability, customer experience, and business operations.

By bringing zone redundancy to Standard v2, we are making it easier for organizations to build highly resilient API platforms that can serve as the foundation for next-generation AI and digital transformation initiatives.

Getting Started

Zone Redundancy for Standard v2 can be enabled in supported Azure regions, allowing customers to deploy API Management with built-in protection against Availability Zone failures.

We recommend reviewing your application's overall resiliency architecture, including backend redundancy, traffic management, and disaster recovery requirements, to maximize the benefits of zone-resilient API infrastructure.

Enable Zone Redundancy in the Azure Portal

Getting started with Zone Redundancy in Azure API Management Standard v2 is straightforward and can be configured during service creation.

Create a New Standard v2 Instance with Zone Redundancy

  1. Sign in to the Azure portal.
  2. Select Create a Resource and search for Azure API Management.
  3. Choose Standard v2 as the service tier.
  4. Select a region that supports Availability Zones.
  5. In the Availability Zones section, enable Zone Redundancy.
  6. Review and create the service.

After deployment, Azure API Management automatically distributes service capacity across multiple Availability Zones within the selected region, helping maintain API availability during a zone-level outage.

 

Looking Ahead

This release represents another step in our ongoing investment in the Azure API Management v2 platform. We remain committed to delivering the reliability, scalability, security, and developer experiences that organizations expect from a modern API management service.

We are excited to see what our customers build with a more resilient Standard v2 platform and look forward to your feedback as you continue modernizing and scaling your API ecosystems on Azure.

Learn more by visiting the Azure API Management documentation and exploring the latest reliability guidance for API Management deployments.

Read the whole story
alvinashcraft
1 minute ago
reply
Pennsylvania, USA
Share this story
Delete

High-Performance C♯ in Practice - Zero-Allocation Spans, Memory Safety, and .NET 10 Best Practices

1 Share

In high-throughput microservices, real-time gaming engines, and financial computing systems, minimizing managed heap allocations is one of the most effective strategies for eliminating Garbage Collection (GC) pauses and maximizing application throughput.

 

As of today, the stable production foundation powering enterprise software is C# 14 running on .NET 10, while preview releases for C# 15 and .NET 11 continue to advance the runtime. In this practical technical guide, we explore zero-allocation idioms, span-based buffer slicing, SIMD-accelerated searches, and frozen collections to help you write high-performance C# code.

 

High performance C# programming and zero-allocation memory architecture
Exploring zero-allocation spans, memory safety, and high-throughput .NET 10 runtime performance.

 

Table of Contents

 

  • Understand the lifecycle costs of Gen 0 and Gen 1 Garbage Collection pauses in high-throughput enterprise APIs.
  • Master contiguous buffer slicing using ReadOnlySpan<T> and Span<T> to process binary payloads with zero heap allocation.
  • Learn how stackalloc and ref struct semantics safely allocate temporary working buffers on the thread stack.
  • Accelerate substring and character lookups by up to 10x using SIMD-backed SearchValues<T> patterns.
  • Achieve sub-nanosecond dictionary and set queries using immutable, pre-hashed FrozenSet<T> and FrozenDictionary collections.

The Zero-Allocation Imperative in Cloud-Native .NET 10

In traditional application development, creating small temporary objects—such as string substrings, byte arrays, and intermediate list collections—is standard practice. However, when a cloud-native microservice handles tens of thousands of concurrent requests per second, millions of short-lived heap allocations quickly accumulate in Generation 0.

 

While the .NET Garbage Collector is among the most sophisticated in the industry, frequent GC collection cycles introduce thread pauses, CPU cache thrashing, and unpredictable tail latencies. In our look at the historical evolution of C# language features, we observed how modern versions increasingly prioritize mechanical sympathy with underlying hardware.

 

Zero-allocation programming in C# does not mean avoiding the heap entirely; it means ensuring that hot execution paths process streaming buffers and parse incoming payloads without creating temporary garbage.

 

When architecting distributed backend services, adopting architecting modern cloud-native enterprise applications ensures that low-allocation C# pipelines translate directly into reduced cloud infrastructure costs.

 

 

 

Slicing Memory without Heap Overhead - Spans, ReadOnlySpans, and MemoryMarshal

The introduction of ReadOnlySpan<T> revolutionized memory management in C#. A span represents a contiguous region of arbitrary memory (stack, heap, or unmanaged native memory) that provides type-safe, bounds-checked access without copying underlying bytes.

 

Instead of using string.Substring(), which allocates a brand-new string on the heap for every operation, developers can slice a string or byte array as a ReadOnlySpan<char> with zero allocation overhead.

 

Before: Heap Allocations with string.Substring

public class LegacyHeaderParser
{
    // Allocates multiple new string objects on the managed heap for every parsed header
    public (string Scheme, string Host) ParseAuthorization(string authHeader)
    {
        int spaceIndex = authHeader.IndexOf(' ');
        if (spaceIndex == -1) return (string.Empty, string.Empty);

        string scheme = authHeader.Substring(0, spaceIndex); // Heap Allocation 1
        string token = authHeader.Substring(spaceIndex + 1);  // Heap Allocation 2
        return (scheme, token);
    }
}

After: Zero-Allocation with ReadOnlySpan<char>

using System;

public class HighPerformanceHeaderParser
{
    // Zero heap allocations! Slices memory in place on the stack
    public bool TryParseAuthorization(ReadOnlySpan<char> authHeader, out ReadOnlySpan<char> scheme, out ReadOnlySpan<char> token)
    {
        int spaceIndex = authHeader.IndexOf(' ');
        if (spaceIndex == -1)
        {
            scheme = default;
            token = default;
            return false;
        }

        scheme = authHeader.Slice(0, spaceIndex);        // 0 bytes allocated
        token = authHeader.Slice(spaceIndex + 1);       // 0 bytes allocated
        return true;
    }
}

By switching string-parsing and packet-decoding pipelines to ReadOnlySpan<char> and ReadOnlySpan<byte>, high-throughput web servers eliminate gigabytes of daily garbage collection churn.

 

 

Stack Allocation, Ref Structs, and Generic Anti-Constraints

When temporary scratchpad memory is required during parsing or mathematical transformations, allocating a byte array (new byte[256]) forces a heap allocation. Modern C# allows developers to allocate small temporary buffers directly on the execution stack using stackalloc.

 

Because stack-allocated buffers are automatically cleaned up when the containing method frame exits, they bypass the Garbage Collector entirely.

 

High performance software engineering and memory architectures
Stack memory buffer allocations, ref struct lifecycles, and generic anti-constraints in modern .NET.

 

Zero-Allocation Hex Encoding with stackalloc

public static class FastEncoder
{
    public static string ToHex(ReadOnlySpan<byte> bytes)
    {
        // Allocate temporary char buffer on the stack (max 512 chars)
        Span<char> hexBuffer = stackalloc char[bytes.Length * 2];
        const string hexAlphabet = "0123456789ABCDEF";

        for (int i = 0; i < bytes.Length; i++)
        {
            byte b = bytes[i];
            hexBuffer[i * 2] = hexAlphabet[b >> 4];
            hexBuffer[i * 2 + 1] = hexAlphabet[b & 0x0F];
        }

        // Only one heap allocation: the final returned string
        return new string(hexBuffer);
    }
}

The 'allows ref struct' Anti-Constraint

In modern C#, the allows ref struct generic constraint enables ref struct types (like ReadOnlySpan<T>) to be used as generic type arguments in interfaces and delegate handlers without violating stack safety rules:

 

public interface ISpanProcessor<T> where T : allows ref struct
{
    void Process(T data);
}

public class FastBufferHandler : ISpanProcessor<ReadOnlySpan<byte>>
{
    public void Process(ReadOnlySpan<byte> data)
    {
        // Process stack-bound data efficiently
    }
}

This capability allows enterprise architectures to build highly abstracted, reusable pipelines while preserving zero-allocation performance guarantees.

 

 

High-Speed String and Buffer Searching with SearchValues

Checking whether a string contains illegal characters, delimiters, or forbidden symbols is a frequent bottleneck in web routing, SQL sanitization, and JSON deserialization.

 

The SearchValues<T> class pre-computes an optimized lookup structure at application startup. When invoked, it leverages vectorized hardware SIMD (AVX-512, AVX2, ARM Neon) instructions to scan entire 16-byte or 32-byte chunks of memory in a single CPU cycle.

 

Optimizing Delimiter Detection with SearchValues

using System;
using System.Buffers;

public class HighSpeedSanitizer
{
    // Pre-computed SIMD search structure initialized once at startup
    private static readonly SearchValues<char> s_invalidUrlChars = 
        SearchValues.Create("\"<>\\^`{|}[] ");

    public static bool ContainsInvalidUrlCharacters(ReadOnlySpan<char> urlSegment)
    {
        // Executes vectorized SIMD hardware instructions: up to 10x faster than foreach!
        return urlSegment.ContainsAny(s_invalidUrlChars);
    }
}

Replacing traditional string.IndexOfAny() loops with SearchValues<T> delivers dramatic speedups across high-frequency validation routines.

 

 

Sub-Nanosecond Lookup Caching - FrozenSet and FrozenDictionary

In many enterprise applications, reference datasets (such as country codes, HTTP status mappings, permissions, and routing tables) are initialized once during startup and never modified during the application's runtime.

 

While standard Dictionary and HashSet collections must maintain mutable buckets to support dynamic additions, FrozenDictionary<TKey, TValue> and FrozenSet<T> analyze the exact key distribution during creation to generate a mathematically perfect, branch-optimized lookup table.

 

Creating and Using Frozen Collections

using System.Collections.Frozen;
using System.Collections.Generic;

public class RouteConfigManager
{
    // Frozen during application startup: optimized exclusively for blistering-fast reads
    private static readonly FrozenDictionary<string, int> s_routeWeights = 
        new Dictionary<string, int>
        {
            ["/api/v1/users"] = 10,
            ["/api/v1/orders"] = 25,
            ["/api/v1/payments"] = 50,
            ["/api/v1/analytics"] = 5
        }.ToFrozenDictionary(StringComparer.OrdinalIgnoreCase);

    public static int GetRouteWeight(string path)
    {
        return s_routeWeights.TryGetValue(path, out int weight) ? weight : 0;
    }
}

Frozen collections achieve up to 50% faster read times compared to standard dictionaries by utilizing length-based hashing and eliminating thread-safety synchronization locks.

 

To ensure that these low-level optimizations maintain codebase maintainability across engineering teams, incorporating rigorous code review standards for software engineering helps identify unintended boxing operations early.

 

Furthermore, equipping your team with modern IDE extensions from our top developer tools and IDE productivity extensions ensures instant linting feedback on allocation hot spots.

 

 

Frequently Asked Questions (FAQ)

Here are answers to the most common questions developers ask regarding high-performance C# programming and memory management:

 

1. What is the main difference between Span<T> and ReadOnlySpan<T>?

Span<T> provides a mutable view over a contiguous memory buffer, allowing you to modify elements directly. ReadOnlySpan<T> provides an immutable, read-only view, making it ideal for string slicing and immutable buffer parsing.

 

2. Why can't a ref struct be stored as a field inside a normal class?

A ref struct is strictly allocated on the thread execution stack. Allowing it to be stored inside a class instance on the managed heap could lead to dangling stack pointers when the stack frame unwinds.

 

3. How does stackalloc prevent Garbage Collection pauses?

Memory allocated via stackalloc lives on the call stack rather than the managed heap. It is automatically reclaimed when the method returns, requiring zero intervention from the Garbage Collector.

 

4. When should I use Memory<T> instead of Span<T>?

Use Memory<T> (or ReadOnlyMemory<T>) when memory slices need to outlive the current stack frame, such as across asynchronous await boundaries or when storing buffer references inside heap objects.

 

5. How does SearchValues<T> achieve 10x faster search speeds?

SearchValues analyzes search characters during construction and emits specialized SIMD vector instructions (like AVX2 and ARM Neon) that compare multiple bytes simultaneously in single CPU clock cycles.

 

6. What is the performance advantage of FrozenDictionary over standard Dictionary?

FrozenDictionary generates an optimized, immutable hash lookup table during creation, eliminating internal bucket collision handling and delivering sub-nanosecond read latency for read-heavy datasets.

 

7. Is .NET 10 able to allocate small arrays of reference types on the stack?

Yes. .NET 10 introduces JIT enhancements where small arrays of reference types that do not escape their local method context can be stack-allocated, eliminating unnecessary heap allocations.

 

8. Can I convert a ReadOnlySpan<char> back to a string without allocating?

No. Creating a new string object always requires a heap allocation. The key to high performance is passing and processing ReadOnlySpan<char> across intermediate methods without converting to string until strictly necessary.

 

9. How do I benchmark memory allocations in my C# methods?

You can use the popular BenchmarkDotNet library with the [MemoryDiagnoser] attribute to measure exact allocated bytes and Garbage Collection collection counts across Gen 0, Gen 1, and Gen 2.

 

10. What is the allows ref struct constraint in C# 14?

It is an anti-constraint that allows generic classes, interfaces, and methods to accept ref struct types (like ReadOnlySpan<T>), enabling reusable generic pipelines with stack-bound performance.

 

High-performance C# engineering empowers developers to extract maximum throughput and predictability from modern hardware without sacrificing code clarity or memory safety. By incorporating spans, stack allocations, SIMD search utilities, and frozen collections into your daily engineering practices, you can build enterprise applications that handle massive traffic with near-zero latency overhead.

 

Take time this week to profile your core service endpoints using BenchmarkDotNet, identify your most frequent heap allocations, and refactor hot parsing loops into zero-allocation span pipelines.

 

Which zero-allocation C# technique or modern collection type has delivered the biggest performance improvement in your codebase? Share your benchmarks, experiences, and questions in the comments section below!

 

Read the whole story
alvinashcraft
1 minute ago
reply
Pennsylvania, USA
Share this story
Delete
Next Page of Stories