improve walker class
|Reported by:||hailin||Owned by:|
walker class has the same issue as described in page_rows() in #7286.
Basically we can not guarantee worst case performance, which may take up to
O(number of top level elements * number of children elements).
The proposed fix has O(N) complexity in the worst, best, and average case.