Skip to content

Commit

Permalink
Inlined any Reader/Writer#tag calls, also fixes #556
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Dec 14, 2016
1 parent 70c9c6e commit b0aef62
Show file tree
Hide file tree
Showing 26 changed files with 527 additions and 312 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
npm-debug.*
node_modules/
types/types.d.ts
bench.txt
docs/
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
npm-debug.*
node_modules/
types/types.d.ts
bench.txt
docs/
examples/
src/util/aspromise/
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,11 @@ usage: pbts [options] file1.js file2.js ...

### Descriptors vs. static modules

While .proto and JSON files require the full library (about 18kb gzipped), pretty much all code but the relatively short descriptors is shared. Hence, it usually doesn't become much larger than that.
While .proto and JSON files require the full library (about 18kb gzipped, all features including reflection, parser and utility), pretty much all code but the relatively short descriptors is shared.

Static code, on the other hand, requires just the minimal runtime (about 5.5kb gzipped, no reflection features), but generates relatively large codebases that you can edit or strip down by hand.
Static code, on the other hand, requires just the minimal runtime (about 5.5kb gzipped, i.e. no reflection features), but generates additional, albeit editable and customizable, source code.

When `new Function` is supported (and it usually is), there is no difference performance-wise as the code generated statically is the same as generated at runtime.
When `new Function(...)` is supported (and it usually is), there is no difference performance-wise as the code generated statically is the same as generated at runtime.

Building
--------
Expand Down
2 changes: 1 addition & 1 deletion bench/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var protobuf = require(".."),
var root = protobuf.loadSync(require.resolve("./bench.proto"));
var Test = root.lookup("Test");

protobuf.util.codegen.verbose = true;
// protobuf.util.codegen.verbose = true;

var buf = Test.encode(data).finish();

Expand Down
Loading

0 comments on commit b0aef62

Please sign in to comment.