-1

See this link.

At the moment an extension is sorting the list through a tag (using a render hook?):

<sort2>
* C
* A
* B
</sort2>

Outputs:

  • A
  • B
  • C

However, the result is temporary in that it is kicking in each time the page is loaded and this might have downsides as the list grows.

Can you think of another way to achieve the same?

Perhaps there's a way of saving the output to the wiki page/database.

P.S: Posted this here as the question does not seem a fit for SO.

James P.
  • 1,223
  • 2
  • 9
  • 19
  • 1
    Close requesters you are invited to say what is unclear. Have updated the question. – James P. Dec 02 '16 at 01:14
  • 4
    *"this might have downsides as the list grows."* Wait until it *has* downsides. You might find your lists never get that big. This is likely premature optimization. – Roman Reiner Dec 02 '16 at 05:46
  • 3
    1) Have you any benchmarks showing performance problems? Sorting cost should be comparable to other markup transformations (assuming it's properly implemented). 2) Doesn't mediawiki cache whole pages? I vaguely remember such a feature from using it a few years ago. You could even use a CDN to cache the full html for users who aren't logged in. – CodesInChaos Dec 02 '16 at 13:17

2 Answers2

5

The thing to take advantage of here is that one write is read many times. Sort on the write, not on the read.

Up to you if you want to do that client or server side. But if letting clients sort on the read is not good enough, that's the next step.

candied_orange
  • 102,279
  • 24
  • 197
  • 315
1

The sort exension appears to be a server side component in php. So you shouldn't worry about its performance unless the list gets REALLY big ie 1 million

I would go towards a manual solution rather than try and code this functionality. As its a wiki you already have built in editing tools. With people adding their own names to the list you will inevitably get mistakes and inconsistent formatting. So you are going to need to edit it occasionally anyway. When you do, sort the list.

Ewan
  • 70,664
  • 5
  • 76
  • 161
  • "the result is temporary in that it is kicking in each time the page is loaded" but i see that is in fact php. why do you have a concern? – Ewan Dec 02 '16 at 14:00
  • Ewan, that's a clever solution. Hadn't thought of that and a clientside sort could be done. – James P. Dec 02 '16 at 21:50
  • I have a slight concern about the possibility that someone could repeatedly edit the page and trigger this extension at the same time. Thinking about it now, there's probably some measures that exist to limit the number of page saves anyway so that shouldn't be a problem. – James P. Dec 02 '16 at 21:52