vuonghungvinh / tree-view-list-android

Automatically exported from code.google.com/p/tree-view-list-android
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

bad performance to build a tree #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.build a tree with about 40 node
2.it take about 2 seconds.
3.every time the logcat out print : Creating the view a new,that is inflate the 
layout xml consume too many time.So,why "Reusing the view" do not work.

What is the expected output? What do you see instead?
copy node or duplicate class to make fast,do not need inflate the layout xml 
every time.

Original issue reported on code.google.com by yunjie....@gmail.com on 7 Sep 2013 at 3:28

GoogleCodeExporter commented 9 years ago
Please explain what exactly you do. You are supposed to build the tree first 
(Tree manager) and then connect it to the view, not the other way round. You 
should not rebuild the tree while it is connected. Your problem comes from the 
fact (most likely - since I do not know your code), that you add nodes to the 
tree manager when it is connected to the view. If you want to add/remove one 
node in such case - it's better than rebuild the whole tree (and should be done 
without disconnecting the manager) but if you build it from scratch, it is not 
wise.

Original comment by ja...@potiuk.com on 8 Sep 2013 at 12:37

GoogleCodeExporter commented 9 years ago

Original comment by ja...@potiuk.com on 8 Sep 2013 at 12:43

GoogleCodeExporter commented 9 years ago
I don't think we should close issues before we really get clear.

Actually,you can test the  tree-building performance by yourself,very 
simple,you and the follow code in TreeViewListDemo.onCreate()

at beginning of onCreate:
long begin = System.currentTimeMillis(); 

at end of onCreate:
Log.e("TreeViewListDemo", "time:"+(System.currentTimeMillis()-begin));

run TreeViewListDemo and will get about 2xx ms in build tree,that is only 6 
node.
You can increase node to 60,build 3-level tree,every parent has 2-5 child.

It will take about 2 seconds,even more sometimes.

So,I don't think we should ignore this issue.

Original comment by yunjie....@gmail.com on 8 Sep 2013 at 4:12

GoogleCodeExporter commented 9 years ago
I am not able to help, sorry. The project has not been maintained for a long 
time, and resurrecting it is not the best idea for interface on a mobile 
device- according to the new design guidelines from Android there is no place 
for such navigation (and rigthfully so). You should think abour redesigning 
your app to use different paradigms (for example only displaying one level of 
tree at a time  in simple list. It's much more efficient way of dealing with 
the problem. 

Original comment by ja...@potiuk.com on 8 Sep 2013 at 11:39

GoogleCodeExporter commented 9 years ago
If you don't want maintain anymore,I suggest you let those issue
reopen.Another guys should notice those before he use tree-view-list.
And also,some guys happen to help fix those problem,or I will have a try
later.

Original comment by yunjie....@gmail.com on 9 Sep 2013 at 2:10