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

Issue 813373003: Protobuf changes for smaller dart2js code, Int64 fixes (Closed)

Created:
6 years ago by sra1
Modified:
5 years, 11 months ago
CC:
reviews_dartlang.org, Søren Gjesse
Base URL:
https://github.com/dart-lang/dart-protoc-plugin@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Protobuf changes for smaller dart2js code, Int64 fixes This change is paired with https://chromiumcodereview.appspot.com/814213003 Reduces code size for one app by 0.9% 1. Allow constants for the default value to avoid many trivial closures. 2. Generate and use static M.create() and M.createRepeated() methods on message classes M to ensure there is a shared copy of these closures rather than one copy per use. 3. Parse Int64 values rather than generate from 'int' to ensure no truncation errors in JavaScript. R=sigmund@google.com Committed: https://github.com/dart-lang/protoc-plugin/commit/fec382b4a8574ecbd17e18be89fb16ad807f064f

Patch Set 1 #

Total comments: 1

Patch Set 2 : bump version #

Total comments: 8

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+151 lines, -79 lines) Patch
M lib/message_generator.dart View 1 2 3 chunks +10 lines, -2 lines 0 comments Download
M lib/protobuf_field.dart View 1 2 8 chunks +22 lines, -21 lines 0 comments Download
M lib/src/descriptor.pb.dart View 38 chunks +83 lines, -39 lines 0 comments Download
M lib/src/plugin.pb.dart View 6 chunks +10 lines, -5 lines 0 comments Download
M pubspec.yaml View 1 1 chunk +2 lines, -2 lines 0 comments Download
M test/file_generator_test.dart View 10 chunks +18 lines, -8 lines 0 comments Download
M test/generated_message_test.dart View 1 chunk +2 lines, -0 lines 0 comments Download
M test/message_generator_test.dart View 2 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 9 (2 generated)
sra1
6 years ago (2014-12-19 17:54:57 UTC) #2
sra1
https://chromiumcodereview.appspot.com/813373003/diff/1/pubspec.yaml File pubspec.yaml (right): https://chromiumcodereview.appspot.com/813373003/diff/1/pubspec.yaml#newcode13 pubspec.yaml:13: dependency_overrides: I will delete this :-)
6 years ago (2014-12-19 18:26:15 UTC) #3
Siggi Cherem (dart-lang)
https://chromiumcodereview.appspot.com/813373003/diff/20001/lib/message_generator.dart File lib/message_generator.dart (right): https://chromiumcodereview.appspot.com/813373003/diff/20001/lib/message_generator.dart#newcode112 lib/message_generator.dart:112: } else if (field.group) { after chatting about it ...
6 years ago (2014-12-19 21:53:14 UTC) #4
sra1
https://chromiumcodereview.appspot.com/813373003/diff/20001/lib/message_generator.dart File lib/message_generator.dart (right): https://chromiumcodereview.appspot.com/813373003/diff/20001/lib/message_generator.dart#newcode112 lib/message_generator.dart:112: } else if (field.group) { On 2014/12/19 21:53:14, Siggi ...
6 years ago (2014-12-19 23:11:02 UTC) #5
Siggi Cherem (dart-lang)
lgtm
6 years ago (2014-12-19 23:30:17 UTC) #6
sra1
Committed patchset #3 (id:40001) manually as fec382b4a8574ecbd17e18be89fb16ad807f064f (presubmit successful).
6 years ago (2014-12-19 23:33:25 UTC) #7
Søren Gjesse
5 years, 11 months ago (2015-01-05 16:00:07 UTC) #9
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/813373003/diff/20001/lib/message_gener...
File lib/message_generator.dart (right):

https://chromiumcodereview.appspot.com/813373003/diff/20001/lib/message_gener...
lib/message_generator.dart:114: subBuilderRepeated = '()${SP}=>${SP}new
PbList<${fieldType}>()';
On 2014/12/19 21:53:14, Siggi Cherem (dart-lang) wrote:
> not for this CL, but I'll ask since I'm thinking about it here. I haven't read
> this code in a long time - any reason why we are using $SP at all? it seems
just
> noise... 
> 
> Søren - do you know of any reasons for it?

I don't see any reason for using ${SP} when generating the code. I think this
dates back several years, and everybody (including me) have just kept that
style. I will be great to just change it to spaces.

Powered by Google App Engine
This is Rietveld 408576698