Skip to content
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

quick sort for an array with length 359032 from scc data is slow #13

Closed
scozv opened this issue Dec 12, 2013 · 2 comments
Closed

quick sort for an array with length 359032 from scc data is slow #13

scozv opened this issue Dec 12, 2013 · 2 comments

Comments

@scozv
Copy link
Owner

scozv commented Dec 12, 2013

From Algo.js of Google Code on August 02, 2013 17:41:55

What steps will reproduce the problem?

  1. debug stop before sort connect info of scc using 875714 vertex graph data
  2. run heap sort, or merge sort is faster than quick sort by feeling

Please use labels and text to provide additional information.
inspect into it, see whether clone array is slow or not.

Original issue: http://code.google.com/p/algo-js/issues/detail?id=13

@scozv
Copy link
Owner Author

scozv commented Dec 12, 2013

From Algo.js of Google Code on August 05, 2013 00:59:23

here is running time of sorting connect info:

Code Time (ms)
var T = Math.__timer__;
T(function(){Sorting.quickSort(connect, function(x, y){return y-x;})}); 6209
T(function(){Sorting.quickSort(connect)}); 326
T(function(){Sorting.mergeSort(connect, function(x, y){return y-x;})}); 405
T(function(){Sorting.mergeSort(connect)}); 509
T(function(){Sorting.mergeSortBU(connect, function(x, y){return y-x;})}); 403
T(function(){Sorting.mergeSortBU(connect);}); 427
T(function(){Sorting.heapSort(connect, {order:'ASC'})}); 292
T(function(){Sorting.heapSort(connect, {order:'DESC'})}); 207

Status: Started

@scozv
Copy link
Owner Author

scozv commented Dec 12, 2013

From Algo.js of Google Code on September 27, 2013 02:38:29

fixed in revision 6bf2dfd

@scozv scozv closed this as completed Dec 12, 2013
scozv referenced this issue Dec 12, 2013
add skipClone parameter for quickSort indicating that we want to skip clone in sort
use this version of quickSort in Kosaraju SCC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant