| ef8e3583 | 03-Sep-2010 |
Jed Brown <jed@59A2.org> |
Speed up PetscSortInt
* Use median of first,middle,last for quicksort pivot selection.
* Use less intrusive partitioning algorithm (many fewer swaps for almost-sorted array).
* Don't use PetscFu
Speed up PetscSortInt
* Use median of first,middle,last for quicksort pivot selection.
* Use less intrusive partitioning algorithm (many fewer swaps for almost-sorted array).
* Don't use PetscFunctionBegin/Return for the private recursive function. It costs some, but more importantly, the depth of recursion is data-dependent, so it can blow PETSc's stack, thus making PETSc-provided stack traces useless. The function could never fail anyway, so this does not lose any error-handling capability.
Hg-commit: fb7c48e8b48592b96e14699d81e26f05f9a780b4
show more ...
|