|
Re: Any efficient way to save table item(I/O) ?? [message #465952 is a reply to message #465951] |
Mon, 26 December 2005 03:04 |
Johnson Messages: 13 Registered: July 2009 |
Junior Member |
|
|
I share some different methods to save a huge table. Here are my
experiments:
1. the slowest way, about 28 seconds
for(int i = 0 ; i < items.length; i++}
for(int j = 0 ; j < = table.getColumnCount(); j++
content += items[i].getText(j) + " , " ;
2. a little bit faster, about 20 seconds
for(int i = 0 ; i < items.length; i++){
StaticText o = (StaticText)items[i].getData();
content += o.getIndex() + " , ";
content += o.getObjID() + " , ";
content += o.getWidth() + " , ";;
content += o.getHeight() + " , ";;
content += o.getX() + " , ";;
content += o.getY() + " , ";;
content += o.getIsShow() + " , ";;
content += o.getIsFillBgColor() + " , ";;
content += o.getIsUseOwnBgColor() + " , ";;
.................
}
3. the fastest way, about 5 seconds
for(int i = 0 ; i < items.length; i++){
StaticText o = (StaticText)items[i].getData();
content += o.getIndex() + " , " + o.getObjID() + " , " + o.getWidth()
+ " , "
+ o.getHeight() + " , " + o.getX() + " , " + o.getY() + " , " +
o.getIsShow() + " , "
+ o.getIsFillBgColor() + " , " + o.getIsUseOwnBgColor() + " , " +
o.getIsUseOwnTextColor() + " , "
+ o.getIsUseOwnString() + " , " + o.getIsMultiLine() + " , " +
o.getIsAutoWordwrap() + " , " + o.getOwnBgColor() + " , "
+ o.getOwnTextColor() + " , " + o.getOwnFontSizeIdx() + " , " +
o.getHoriTextAlignStyleIdx() + " , "
+ o.getVertTextAlignStyleIdx() + " , " + o.getResID() + " , " +
o.getResID();
}
It is fastest if I use getData() and one line to get whole the item.
Is there any way faster? Users would feel uncomfortable to save a table with
4 more seconds. Thanks
"Johnson" <ljshuenn@realtek.com.tw>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03423 seconds