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

Issue 1998833002: Use BufferContext + offset instead of BufferPointer. (Closed)

Created:
4 years, 7 months ago by scheglov
Modified:
4 years, 7 months ago
Reviewers:
Paul Berry
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Use BufferContext + offset instead of BufferPointer. This lets us avoid creating tens of millions of BufferPointer instances and makes DDC compilation about 6% faster. R=paulberry@google.com BUG= Committed: https://github.com/dart-lang/sdk/commit/0f441fa3ea361ae6d9a88c07e29ce17c6e7d2a9d

Patch Set 1 #

Total comments: 6

Patch Set 2 : tweaks #

Unified diffs Side-by-side diffs Delta from patch set Stats (+519 lines, -480 lines) Patch
M pkg/analyzer/lib/src/summary/flat_buffers.dart View 1 19 chunks +72 lines, -72 lines 0 comments Download
M pkg/analyzer/lib/src/summary/format.dart View 70 chunks +386 lines, -354 lines 0 comments Download
M pkg/analyzer/test/src/summary/flat_buffers_test.dart View 12 chunks +48 lines, -43 lines 0 comments Download
M pkg/analyzer/tool/summary/build_sdk_summaries.dart View 1 chunk +4 lines, -3 lines 0 comments Download
M pkg/analyzer/tool/summary/generate.dart View 5 chunks +9 lines, -8 lines 0 comments Download

Messages

Total messages: 5 (1 generated)
scheglov
4 years, 7 months ago (2016-05-19 21:47:47 UTC) #1
Paul Berry
lgtm https://codereview.chromium.org/1998833002/diff/1/pkg/analyzer/lib/src/summary/flat_buffers.dart File pkg/analyzer/lib/src/summary/flat_buffers.dart (right): https://codereview.chromium.org/1998833002/diff/1/pkg/analyzer/lib/src/summary/flat_buffers.dart#newcode50 pkg/analyzer/lib/src/summary/flat_buffers.dart:50: ByteData buf = new ByteData.view(uint8List.buffer); I think if ...
4 years, 7 months ago (2016-05-19 22:12:32 UTC) #2
scheglov
Committed patchset #2 (id:20001) manually as 0f441fa3ea361ae6d9a88c07e29ce17c6e7d2a9d (presubmit successful).
4 years, 7 months ago (2016-05-20 03:08:31 UTC) #4
scheglov
4 years, 7 months ago (2016-05-20 03:08:52 UTC) #5
Message was sent while issue was closed.
https://codereview.chromium.org/1998833002/diff/1/pkg/analyzer/lib/src/summar...
File pkg/analyzer/lib/src/summary/flat_buffers.dart (right):

https://codereview.chromium.org/1998833002/diff/1/pkg/analyzer/lib/src/summar...
pkg/analyzer/lib/src/summary/flat_buffers.dart:50: ByteData buf = new
ByteData.view(uint8List.buffer);
On 2016/05/19 22:12:32, Paul Berry wrote:
> I think if we do:
> 
> ByteData buf = new ByteData.view(uint8List.buffer, uint8List.offsetInBytes)
> 
> then we ought to be able to get rid of the _offset field, since the offset
will
> automatically be accounted for by the native ByteData implementation.

Done.

https://codereview.chromium.org/1998833002/diff/1/pkg/analyzer/lib/src/summar...
pkg/analyzer/lib/src/summary/flat_buffers.dart:57: return offset +
_getUint32(offset);
On 2016/05/19 22:12:32, Paul Berry wrote:
> I think this should be:
> 
> return offset + _getUint32(_offset + offset);
> 
> (Of course, if we get rid of _offset, then it's correct as is)

_getUint32() already applies _offset.

https://codereview.chromium.org/1998833002/diff/1/pkg/analyzer/lib/src/summar...
pkg/analyzer/lib/src/summary/flat_buffers.dart:848: //    _length ??=
bp._getUint32(offset);
On 2016/05/19 22:12:32, Paul Berry wrote:
> Did you forget to delete this?

Don't remember already why made this change at all.
Restored to its original lazy state.

Powered by Google App Engine
This is Rietveld 408576698