Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Issue 10532193: Quicksort: Choose pivot with recursive sort of pivot candidates on large arrays to avoid patholgi... (Closed)

Created:
8 years, 6 months ago by Erik Corry
Modified:
8 years, 6 months ago
Reviewers:
danno
CC:
v8-dev
Visibility:
Public.

Description

Quicksort: Choose pivot with recursive sort of pivot candidates on large arrays to avoid patholgical cases. Committed: http://code.google.com/p/v8/source/detail?r=11873

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 5

Patch Set 5 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+166 lines, -3 lines) Patch
M src/array.js View 1 2 3 2 chunks +21 lines, -3 lines 0 comments Download
A test/mjsunit/regress/regress-2185-2.js View 1 2 3 4 1 chunk +145 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Erik Corry
8 years, 6 months ago (2012-06-18 11:57:33 UTC) #1
danno
How about adding a unit test that triggers the slow behavior in the current implementation? ...
8 years, 6 months ago (2012-06-19 14:52:17 UTC) #2
Erik Corry
Regression test uploaded https://chromiumcodereview.appspot.com/10532193/diff/6001/src/array.js File src/array.js (right): https://chromiumcodereview.appspot.com/10532193/diff/6001/src/array.js#newcode781 src/array.js:781: var t_array = []; On 2012/06/19 ...
8 years, 6 months ago (2012-06-19 18:36:29 UTC) #3
danno
8 years, 6 months ago (2012-06-19 19:55:55 UTC) #4
lgtm

http://codereview.chromium.org/10532193/diff/6001/src/array.js
File src/array.js (right):

http://codereview.chromium.org/10532193/diff/6001/src/array.js#newcode781
src/array.js:781: var t_array = [];
Nah, it's fine. I'd rather have the readable code and know it's right.

On 2012/06/19 18:36:29, Erik Corry wrote:
> On 2012/06/19 14:52:17, danno wrote:
> > How about creating an InternalArray of the appropriate size here? That
> obviates
> > the need for the push() stub call later (you can just assign to the element)
> 
> OK I tried that and it ended badly.  I have to be 100% sure I get the length
> right and there are multiple chances to make off by 1 errors.  Leaving as it
is
> unless you feel very strongly about this.

Powered by Google App Engine
This is Rietveld 408576698