Intermediate
C#
Q77 / 100
What is object pooling in C# and when should you use it?
Correct! Well done.
Incorrect.
The correct answer is B) Reusing expensive objects (connections, buffers) from a pool instead of creating and destroying them, reducing GC pressure
B
Correct Answer
Reusing expensive objects (connections, buffers) from a pool instead of creating and destroying them, reducing GC pressure
Explanation
ArrayPool<T>.Shared.Rent(size) and Return() reuse arrays. ObjectPool<T> (Microsoft.Extensions) generalizes this. Crucial for high-throughput scenarios.
Progress
77/100