哪个性能更好?

时间:2016-09-01 05:19:17

标签: c# oop

我有1000000个数据,它们有一些关系,或者可以分组到3个组。 我将随机更新并添加到这些数据中。 此外,我可能需要多次搜索一些属性值。

这是类结构

public struct DataGridViewRowInfo
{
   public string Id { get; set; }
   public int CollegeId { get; set; }
   public int RowID;
   public int DepartementId ;
   public string SpecialString { get; set; }       
}

我有以下3个想法来保留它。我想知道哪个更好。

  
      
  1. 保留为上述对象的单个列表
  2.   
  3. 在分层结构中
  4.   
public class CollegeInfo
{
    public int CollegeId { get; set; }
    public Dictionary<int, DepartementInfo> DepartementInfo { get; set; }
}

public class DepartementInfo
{
   public int CollegeId { get; set; }
   public int DepartementId { get; set; }
   public Dictionary<int, DataGridViewRowInfo> DataGridViewRowsInfo { get; set;      }
}

 public struct DataGridViewRowInfo
 {
   public string Id { get; set; }
   public int CollegeId { get; set; }
   public int RowID;
   public int DepartementId ;
   public string SpecialString { get; set; }        
}
  

或3.将数据保存在文件中并对一小组数据进行操作。

0 个答案:

没有答案