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

Issue 12217061: Add ListQueue and make it the default Queue. (Closed)

Created:
7 years, 10 months ago by Lasse Reichstein Nielsen
Modified:
7 years, 10 months ago
Reviewers:
floitsch, sra1
CC:
reviews_dartlang.org, ngeoffray
Visibility:
Public.

Description

Add ListQueue and make it the default Queue. ListQueue has a very low overhead for operations (low memory overhead, better memory locality) compared to a double-linked list solution, but at the cost of only amortized constant time adding. Committed: https://code.google.com/p/dart/source/detail?r=18309

Patch Set 1 #

Total comments: 16

Patch Set 2 : Addressed comments. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+539 lines, -23 lines) Patch
M sdk/lib/collection/queue.dart View 1 3 chunks +383 lines, -7 lines 2 comments Download
M tests/corelib/queue_test.dart View 1 7 chunks +156 lines, -16 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Lasse Reichstein Nielsen
7 years, 10 months ago (2013-02-07 09:49:33 UTC) #1
floitsch
LGTM. Please add tests for the cases where I had comments. https://codereview.chromium.org/12217061/diff/1/sdk/lib/collection/queue.dart File sdk/lib/collection/queue.dart (right): ...
7 years, 10 months ago (2013-02-07 16:44:31 UTC) #2
sra1
I'm wondering if there is a slightly different implementation that shares more code with a ...
7 years, 10 months ago (2013-02-07 19:48:49 UTC) #3
sra1
On 2013/02/07 19:48:49, sra1 wrote: > I'm wondering if there is a slightly different implementation ...
7 years, 10 months ago (2013-02-07 20:07:23 UTC) #4
Lasse Reichstein Nielsen
https://codereview.chromium.org/12217061/diff/1/sdk/lib/collection/queue.dart File sdk/lib/collection/queue.dart (right): https://codereview.chromium.org/12217061/diff/1/sdk/lib/collection/queue.dart#newcode360 sdk/lib/collection/queue.dart:360: int length = source.length; Please elaborate. I need the ...
7 years, 10 months ago (2013-02-11 15:02:32 UTC) #5
floitsch
https://codereview.chromium.org/12217061/diff/7001/sdk/lib/collection/queue.dart File sdk/lib/collection/queue.dart (right): https://codereview.chromium.org/12217061/diff/7001/sdk/lib/collection/queue.dart#newcode566 sdk/lib/collection/queue.dart:566: number = (number << 2) - 1; Still not ...
7 years, 10 months ago (2013-02-11 15:15:11 UTC) #6
sra1
7 years, 10 months ago (2013-02-12 01:09:56 UTC) #7
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/12217061/diff/7001/sdk/lib/collection/...
File sdk/lib/collection/queue.dart (right):

https://chromiumcodereview.appspot.com/12217061/diff/7001/sdk/lib/collection/...
sdk/lib/collection/queue.dart:564: static int _nextPowerOf2(int number) {
This function might be easier to write correctly if you could use int.bitLength,
defined to return the 0-based bit position of the most significant bit that is
different to the sign bit.

https://code.google.com/p/dart/issues/detail?id=5828

int guess = 1 << number.bitLength;
return (guess < number) ? 2 * guess : guess;

Powered by Google App Engine
This is Rietveld 408576698