DataTable.Select vs DataTable.rows.Find vs foreach vs Find(Predicate)/Lambda

前端 未结 5 915
情深已故
情深已故 2020-12-25 15:20

I have a DataTable/collection that is cached in memory, I want to use this as a source to generate results for an auto complete textbox (using AJAX of course). I am evaluati

5条回答
  •  借酒劲吻你
    2020-12-25 15:53

    We could speculate about it all day, but since this is not a huge piece of code, why not write each one and benchmark them against each other?

    public delegate void TestProcedure();
    
    public TimeSpan Benchmark(TestProcedure tp)
    {
        int testBatchSize = 5;
        List results = new List();
        for(int i = 0; i

提交回复
热议问题