Skip to content

Faster sorting algo #999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 15, 2015
Merged

Faster sorting algo #999

merged 1 commit into from
Jan 15, 2015

Conversation

laruence
Copy link
Member

Which could brings us >30% performance improvement in sort series functions.

lots of tests fails due to non-stable sorting vs stable sorting difference(we are using insert sorting algo while elements is le 16)

@nikic
Copy link
Member

nikic commented Jan 14, 2015

How much improvement do the custom swap functions make? Are they a critical part of this improvement?

@laruence
Copy link
Member Author

@nikic it depends, for renum zend_hash_sort, it can save 2 words per exchange..

anyway, it's not the critical part, but for consistent, as you can see, zend_sort_swap require a third parameter siz. but custom swap function doesn't need(swap_func_t).

thus, I'd like keep the swap_func_t to be consistent.

thanks

@php-pulls php-pulls merged commit 2193de0 into php:master Jan 15, 2015
reviewtypo3org pushed a commit to TYPO3/typo3 that referenced this pull request Jan 17, 2015
ArrayUtilityTests expect that order of elements with the same value
will not change. PHP doesn't guarantee that, so it doesn't make
sense to test this behaviour.

This test fails under HHVM which has different sorting
implementation than PHP 5.

Actually PHP 7 is going into the same direction, so sooner
or later this test will fail also under PHP.
See php/php-src#999
and facebook/hhvm#4649

Resolves: #64322
Releases: master
Change-Id: Ie48e57456eee20ff9b1a0efc0ac38413f16c5de1
Reviewed-on: http://review.typo3.org/36055
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
+----------------------------------------------------------------------+
*/

/* $Id$ */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line isn't really needed, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants