Ticket #7353 (closed defect (bug): fixed)

Opened 6 months ago

Last modified 5 months ago

improve walker class

Reported by: hailin Assigned to: anonymous
Priority: normal Milestone: 2.7
Component: General Version:
Severity: normal Keywords:
Cc:

Description

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.

Attachments

7353_improve_walker.diff (3.9 kB) - added by hailin on 07/18/08 23:51:04.
patch

Change History

07/18/08 23:51:04 changed by hailin

  • attachment 7353_improve_walker.diff added.

patch

07/21/08 16:32:15 changed by hailin

tested it to make sure it produces exactly the same output as existing logic.

07/23/08 08:37:29 changed by westi

Is it possible to write unit-tests for the walker class so we have ongoing testability of the output to future proof us?

(follow-up: ↓ 4 ) 07/23/08 12:23:54 changed by jacobsantos

There should already be test cases for the Walker classes. That said, you can never have too many test cases. I point it out, because they can be used as examples for developing more test cases.

(in reply to: ↑ 3 ) 07/23/08 16:44:30 changed by westi

Replying to jacobsantos:

There should already be test cases for the Walker classes. That said, you can never have too many test cases. I point it out, because they can be used as examples for developing more test cases.

Looking through my checkout of the unit-tests I couldn't find any walker class specific tests (unless I am looking in the wrong place).

07/23/08 17:12:53 changed by santosj

Okay, I was wrong. It did have it at one point, I'm not sure what happened to my test suite that I sent Alex. I think with the improvements it was probably set aside or didn't fit anymore.

I'll send him a email and see what's up. The test suite I wrote only covers Walker_Category or some of the child classes of the Walker class, so it won't be all that much use in this case.

I also can't view the revision log online (that I know of), so I'm unaware of where it could have went. At home, I'm currently an earlier revision, so I can check there before I continue.

However, since there aren't currently any test cases, then there should be. I'll try to find my old test suite and improve upon it from there.

07/29/08 22:50:59 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [8494]) Walker improvements from hailin. fixes #7353