You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 23, 2026. It is now read-only.
using System;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
namespace IsConstrainedCopySlower
{
public class Program
{
// Intentionally small to measure the overhead before starting the actual work.
private readonly int[] src = new int[1];
private readonly int[] dst = new int[1];
[Benchmark]
public void ArrayCopy() { Array.Copy(src, 0, dst, 0, 1); }
[Benchmark]
public void ArrayConstrainedCopy() { Array.ConstrainedCopy(src, 0, dst, 0, 1); }
}
}