0
我必须借助LinkedHashMap实现一个表,它具有1000000行和450列。我已经使用嵌套的LinkedHashMap完成了这个。首先我散列到一行然后列来找到一个特定的单元格。 我的值是字符串。 主要问题是它运行速度慢,占用太多内存。 有没有其他办法来解决这个问题。大数据嵌套LinkedHashMap太慢
这里是我Implemeted一个代码..
public LinkedHashMap<String,Row> transitionTable;
// This class represent the one Row of Transition Table
public class Row implements Cloneable{
// This represent the tagCount of a Row
LinkedHashMap<String,Float> tagCount;
float totalOccurance=0f;
//Constructor
public Row()
{
tagCount=new LinkedHashMap<String,Float>();
}
// Method used to do cloning of
public Object Clone() throws CloneNotSupportedException
{
Row row=new Row();
row.tagCount = (LinkedHashMap<String, Float>)this.tagCount.clone();
return row;
}
}
请帮助!
你在用什么'LinkedHashMap'?您是否还想维护广告订单? – Braj 2014-08-29 16:28:58
在数据库而不是内存中进行排序。 – Braj 2014-08-29 16:29:54
我也试过使用HashMap,但没有找到任何改进.......这张表在未来非常频繁,因此将这张表保存在硬盘中并不好。 – 2014-08-29 16:37:17