Make WordPress Core

Opened 17 years ago

Closed 17 years ago

Last modified 14 years ago

#10853 closed enhancement (fixed)

improve get_page_hierarchy

Reported by: hailin Owned by:
Priority: normal Milestone: 3.0
Component: Performance Version: 2.8.4
Severity: normal Keywords: needs-unit-tests
Cc: Focuses:

Description

current get_page_hierarchy has O(N*N) complexity.
It is super slow when N is a few thousands.

We should improve this to O(N) using techniques similar to #10852.

Attachments (1)

10853_page_hier.diff​ (1.9 KB ) - added by hailin 17 years ago.
patch

Download all attachments as: .zip

Change History (10)

@hailin
17 years ago

patch

#1 @hailin
17 years ago

unit tested and verified.
The time improvement is about 500%, even with a small dataset.

#2 follow-up: @hailin
17 years ago

We should not allow O(N*N) complexity in any of WordPress functions :-)
O(N) is what makes Google fast!

#3 @azaozz
17 years ago

  • Resolution → fixed
  • Status new → closed

(In [11976]) Improve get_page_hierarchy, props hailin, fixes #10853

#4 @azaozz
17 years ago

  • Component General → Performance
  • Milestone 2.8.5 → 2.9
  • Version → 2.8.4

#5 in reply to: ↑ 2 @westi
17 years ago

  • Keywords needs-unit-tests added
  • Resolution fixed
  • Status closed → reopened

Replying to hailin:

We should not allow O(N*N) complexity in any of WordPress functions :-)
O(N) is what makes Google fast!

Cool. Could we get these test written up as a patch for WordPress tests so we have performance and functionality tests for this code available?

#6 @ryan
17 years ago

  • Milestone 2.9 → 3.0

#7 @mattrude
17 years ago

  • Cc m@… added

#8 @hakre
17 years ago

  • Resolution → fixed
  • Status reopened → closed

Please create a new ticket instead of re-using this fixed one. New ticket is: #11633

Reference: (In [11976]) Improve get_page_hierarchy, props hailin, fixes #10853

#9 @mbijon
14 years ago

  • Cc mike@… added
Note: See TracTickets for help on using tickets.