คำถามติดแท็ก benchmarkdotnet

1
สิ่งที่สามารถอธิบายค่าใช้จ่ายในการใช้ const ในกรณีนี้
ฉันกระแทกหัวของฉันกับกำแพงที่นี่ดังนั้นฉันหวังว่าบางท่านอาจจะให้การศึกษาแก่ฉัน ฉันกำลังทำการวัดประสิทธิภาพโดยใช้ BenchmarkDotNet และฉันพบกรณีแปลก ๆ นี้ซึ่งดูเหมือนว่าการประกาศสมาชิกconstลดประสิทธิภาพลงอย่างมาก using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Running; using System; namespace PerfTest { [DisassemblyDiagnoser(printAsm: true, printSource: true)] public class Test { private int[] data; private int Threshold = 90; private const int ConstThreshold = 90; [GlobalSetup] public void GlobalSetup() { data = new int[1000]; var random = new …
โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.