上一页 1 2 3 4 5 6 ··· 30 下一页
摘要: [MemoryDiagnoser] public class DMesh3ScenarioBenchmark { private const int N = 2_000_000; // 模拟大规模几何操作 private Random rand = new Random(); [Benchmark] 阅读全文
posted @ 2025-09-09 22:20 JohnYang819 阅读(13) 评论(0) 推荐(0)
摘要: class PointCollectSink : CallbackBase,SimplifiedGeometrySink { public class GlyphContour { public List<RawVector2> Points = new List<RawVector2>(); pu 阅读全文
posted @ 2025-09-07 21:59 JohnYang819 阅读(22) 评论(0) 推荐(0)
摘要: 调用某个异步方法与新线程中启动新的task不同,需要编程人员自己保证async方法快速返回。怎么理解? 这句话指出了异步编程中的一个重要原则:异步方法应该尽可能快速返回控制权。让我详细解释: 核心概念理解 1. 异步方法 vs 新线程 // ❌ 错误理解:异步 == 新线程 async Task D 阅读全文
posted @ 2025-08-27 00:14 JohnYang819 阅读(46) 评论(0) 推荐(0)
摘要: static List<int> CalInts(int len=100000) { List<int> a = Enumerable.Range(0,len).ToList(); return a; } List<int> aa = CalInts(); Stopwatch sw = new St 阅读全文
posted @ 2025-08-04 17:26 JohnYang819 阅读(9) 评论(0) 推荐(0)
摘要: 证明:对于向量a,b,c有ax(bxc)=(a*c)b-(a*b)c 阅读全文
posted @ 2025-07-06 16:02 JohnYang819 阅读(46) 评论(0) 推荐(0)
摘要: 一般情况,C#数组仅支持2GB大小,对于int[]来讲,大概就是:2*1024*1024*1024/4=530870912,但实际上 比这个数值略小。 int bb = 536870897; while (true) { bb++; try { int[] aa = new int[bb]; } c 阅读全文
posted @ 2025-07-04 22:28 JohnYang819 阅读(19) 评论(0) 推荐(0)
摘要: public interface IContactManifold<TManifold> where TManifold : struct, IContactManifold<TManifold> 这个泛型约束 where TManifold : struct, IContactManifold<T 阅读全文
posted @ 2025-07-03 12:41 JohnYang819 阅读(55) 评论(0) 推荐(0)
摘要: [StructLayout(LayoutKind.Sequential,Pack =1)]//Pack此时设为1 public struct MyStrct { public float a; public float b; public float c; public float d; byte 阅读全文
posted @ 2025-06-05 22:55 JohnYang819 阅读(11) 评论(0) 推荐(0)
摘要: 首先致谢该博文,讲解的非常详细:https://blog.csdn.net/u013339596/article/details/19167907?spm=1001.2101.3001.6650.7&utm_medium=distribute.pc_relevant.none-task-blog-2 阅读全文
posted @ 2025-05-18 18:38 JohnYang819 阅读(295) 评论(0) 推荐(0)
摘要: ref Particle p = ref _particles[i]; 是 C# 的引用局部变量语法(ref local),它的作用是直接引用数组中某一项的内存地址,而不是创建该元素的副本。这在性能敏感或需要原地修改数组元素时非常有用。 public struct MyStrct { public 阅读全文
posted @ 2025-05-07 23:22 JohnYang819 阅读(41) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 30 下一页