[buddypress-trac] [BuddyPress Trac] #6864: `bp_sort_by_key()` is slow

buddypress-trac noreply at wordpress.org
Fri Feb 5 02:41:23 UTC 2016

#6864: `bp_sort_by_key()` is slow
 Reporter:  boonebgorges           |       Owner:  boonebgorges
     Type:  defect (bug)           |      Status:  closed
 Priority:  normal                 |   Milestone:  2.5
Component:  API                    |     Version:
 Severity:  normal                 |  Resolution:  fixed
 Keywords:  2nd-opinion has-patch  |
Changes (by boonebgorges):

 * owner:   => boonebgorges
 * status:  new => closed
 * resolution:   => fixed


 In [changeset:"10514"]:
 #!CommitTicketReference repository="" revision="10514"
 Improve performance of `bp_sort_by_key()`.

 `bp_sort_by_key()` originally used `create_function()` to allow sorting by
 dynamic `$type` and `$key`. However, `create_function()` has a tendency to
 perform poorly. PHP 5.3 anonymous closures are much faster, but are
 as long as we support PHP 5.2. So we introduce a new class that plays a
 similar to an anonymous closure, with a similar speed benefit.

 Fixes #6864.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6864#comment:4>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list