Optimization: find views in single traversal.
The app will pass a list of views for Textview translation. Currently, we traverse the view tree for each requested view. That means we will traverse view tree many times. If the requested size of view list is large, it shoule be a performance issue. We refine to find views in sinslge traversal in this change. Use a sample app with many views and layouts and compare the time of two implementations. The average time of original solution is 300000 ~ 600000 ns. The new approach is 150000 ~ 300000 ns. Bug:178989965 Test: Write a sample app with many views and complicate structure, see bug for test sample screenshot. Compare the execute time of two implementation. Change-Id: I5a051740ad40e77ed4a54294368031eb82ab87ab
Loading
Please register or sign in to comment