6.0.0-alpha14
6/26/25

[#4638] Sort speed of Turba_List
Summary Sort speed of Turba_List
Queue Turba
Queue Version HEAD
Type Enhancement
State Rejected
Priority 2. Medium
Owners
Requester thomas.jarosch (at) intra2net (dot) com
Created 11/08/2006 (6805 days ago)
Due
Updated 04/16/2007 (6646 days ago)
Assigned
Resolved 04/16/2007 (6646 days ago)
Milestone
Patch No

History
04/16/2007 02:15:45 PM Chuck Hagenbuch State ⇒ Rejected
 
04/16/2007 08:00:40 AM thomas (dot) jarosch (at) intra2net (dot) com Comment #6 Reply to this comment
Hello Chuck,
Can you please update the patch to be against HEAD, with these rules:
Right now I'm very busy improving the Kolab support so I won't have 
time in the near future to fix this. IIRC the HEAD version of Turba 
does multi-column sorts all the time (sort by firstname, lastname), so 
there would be no real improvement.



I think it's best to close this as WON'T FIX for now.



Cheers,

Thomas


04/13/2007 09:42:12 PM Chuck Hagenbuch Comment #5
Priority ⇒ 2. Medium
Version ⇒ HEAD
Reply to this comment
Can you please update the patch to be against HEAD, with these rules:

- if there is only one sort column use the faster code

- if there are multiple sort columns:

   - if array_multisort is present use it with the faster code

   - otherwise use the old code



I'd be willing to commit such a patch if it works well and obeys 
horde/docs/CODING_STANDARDS, etc.
11/13/2006 07:19:49 PM thomas (dot) jarosch (at) intra2net (dot) com Comment #4 Reply to this comment
We can't accept this patch unfortunately yet because we still support
PHP 4.3, and the patch should be against CVS HEAD.
We could auto-detect the PHP version and use the faster code if possible.



Regarding the CVS HEAD code:

Can you comment on how often multi column search is used?

Is sorting by "lastname, firstname" the default?


11/13/2006 04:33:42 PM Jan Schneider Comment #3
State ⇒ Feedback
Reply to this comment
We can't accept this patch unfortunately yet because we still support 
PHP 4.3, and the patch should be against CVS HEAD.
11/08/2006 10:52:26 PM thomas (dot) jarosch (at) intra2net (dot) com Comment #2 Reply to this comment
The patch is against Turba 2.1.3. I've seen the HEAD version of
turba/lib/List.php is modified to support multi column sorting. I
guess most sort operations are single column. Would it be a good idea
to use the optimized code for single column sorts and fall back to
the slow usort() code for multi column?
I've just seen there is array_multisort() which could do multi column sorting.

According to the PHP manual it lacks SORT_LOCALE_STRING.

After googling I've found out support for the missing flag

was added 2006-08-01. So at least it would work in the future.

SORT_STRING could be an option for iso-8859-1 character encoding, right?
11/08/2006 09:05:30 PM thomas (dot) jarosch (at) intra2net (dot) com Comment #1
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ Sort speed of Turba_List
Queue ⇒ Turba
New Attachment: turba-sort-speed.patch Download
State ⇒ New
Reply to this comment
Hello,



I'm currently optimizing Turba for 8.000+ contact addressbooks.

Sorting 8.000 contacts on a P4 3.0 Ghz currently takes more than ten seconds.

After applying the sort optimize patch, the time goes down to 0.13s :-)



The patch is against Turba 2.1.3. I've seen the HEAD version of 
turba/lib/List.php is modified to support multi column sorting. I 
guess most sort operations are single column. Would it be a good idea 
to use the optimized code for single column sorts and fall back to the 
slow usort() code for multi column?



Cheers,

Thomas


Saved Queries