Hi,
That is very peculiar... it should never be slower than an implementation in PHP - unless your algorithm isn't optimal.
The timing for large numbers of nodes got slower due to a linear lookup (as explained in a previous message too). I implemented a hash table lookup as a replacement. This still does not use a lot of memory and the speed does no longer decrease at large quantities of nodes.

FYI, here are some benchmarks against the multisort routine:

10 nodes
extension 8.39233398438E-05 / 1316
multisort 0.0001380443573 / 3808
100 nodes
extension 0.00014591217041 / 10416
multisort 0.000678062438965 / 32160
1000 nodes
extension 0.000765800476074 / 79868
multisort 0.00885391235352 / 298844
5000 nodes
extension 0.00524711608887 / 284572
multisort 0.110008001328 / 1596844
10000 nodes
extension 0.0113878250122 / 537368
multisort 0.136567831039 / 3252232
20000 nodes
extension 0.0704438686371 / 1042796
multisort 0.370564937592 / 6567656


With kind regards,

Maurice Makaay
Phorum.org

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to