.NET 4.6 added two new methods: GC.TryStartNoGCRegion
and GC.EndNoGCRegion
just for this.
More Related Contents:
- Performance loss caused by Linq [duplicate]
- \d less efficient than [0-9]
- What’s the fastest way to read a text file line-by-line?
- Is “else if” faster than “switch() case”? [duplicate]
- How does having a dynamic variable affect performance?
- Performance surprise with “as” and nullable types
- Implementing a log viewer with WPF
- How to get object size in memory? [duplicate]
- Does C# optimize the concatenation of string literals?
- Debug vs. Release performance
- LINQ: Not Any vs All Don’t
- String interning in .Net Framework – What are the benefits and when to use interning
- Using lambda expressions for event handlers
- C# vs C – Big performance difference
- Fastest function to generate Excel column letters in C#
- SQLite .NET performance, how to speed up things?
- Is Python slower than Java/C#? [closed]
- GC.Collect() and Finalize
- Can .NET Task instances go out of scope during run?
- Check if property has attribute
- Does the order of LINQ functions matter?
- Pros and Cons of using SqlCommand Prepare in C#?
- Why is processing a sorted array slower than an unsorted array?
- HTTPWebResponse + StreamReader Very Slow
- Array bounds check efficiency in .net 4 and above
- Thread.Sleep(0) : What is the normal behavior?
- Performance of Skip (and similar functions, like Take)
- Is BitArray faster in C# for getting a bit value than a simple conjuction with bitwise shift?
- Fastest way to remove first char in a String
- Lock statement vs Monitor.Enter method