create new tag
, view all tags

Feature Proposal: General Sorting Mechanism for TWiki



  • Each module and plugin has its own sort functions
  • Lists are often not sorted case-insensitive because of fear of performance loss, resulting in (for humans) strange word order (see for example Bugs:Item2135)
  • Key sort can be made more efficient

It would be useful to have one sorting mechanism that core code and plugins can use. This core sort code can be tested.


Add a sorting lib to the distributed CPAN directory.

Description and Documentation

I was triggered by A Fresh Look at Efficient Perl Sorting. It is a widely quoted paper that has resulted in CPAN:Sort::Maker - A simple way to make efficient sort subs.

I can see 2 alternatives to use:

More info on sorting

  • CPAN:Sort::External for sorting huge lists - Problem: You have a list which is too big to sort in-memory. Solution: "feed, finish, and fetch" with Sort::External, the closest thing to a drop-in replacement for Perl's sort() function when dealing with unmanageably large lists.

-- Contributors: ArthurClemens


I will investigate how the two libraries perform.

-- ArthurClemens - 26 Oct 2008

Decided at HelsinkiReleaseMeeting2009x04x20 to park this proposal until use case understood and owner found.

-- PeterThoeny - 2009-04-20

Use cases:

  • IP addresses (e.g., see FormattingIp)
  • I have added priorities of 'High', 'Medium', 'Low' to my installation of Action tracker. They don't sort well either unless I prefix a number.
  • Last but not least: sort on multiple table columns! (e.g., SearchOrderOnMoreColumns)

-- SeanCMorgan - 2009-04-21

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2009-04-21 - SeanCMorgan
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.