Skip to content

Commit 4157a0e

Browse files
committed
Also validate map fields, see #526 (this really needs some tests)
1 parent 22200ae commit 4157a0e

File tree

11 files changed

+236
-58
lines changed

11 files changed

+236
-58
lines changed

Diff for: README.md

+6
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,12 @@ JSON to/from buffer x 89,854 ops/sec ±0.79% (93 runs sampled)
440440
Type to/from buffer was fastest
441441
JSON to/from string was 49.0% slower
442442
JSON to/from buffer was 63.9% slower
443+
444+
benchmarking verifying performance ...
445+
446+
Type.verify x 5,941,014 ops/sec ±0.96% (90 runs sampled)
447+
448+
Type.verify was fastest
443449
```
444450

445451
Note that JSON is a native binding nowadays and as such is about as fast as it possibly can get. So, how can protobuf.js be faster?

Diff for: cli/targets/static.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,9 @@ function buildType(ref, type) {
286286
"@param {" + fullName + "|Object} message " + type.name + " or plain object to verify",
287287
"@returns {?string} `null` if valid, otherwise the reason why it is not"
288288
]);
289-
buildFunction(type, "verify", codegen.verify.generate(type), {});
289+
buildFunction(type, "verify", codegen.verify.generate(type), {
290+
util : "$protobuf.util"
291+
});
290292
}
291293

292294
function buildService(ref, service) {

Diff for: dist/protobuf.js

+112-27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/protobuf.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/protobuf.min.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/protobuf.min.js.gz

246 Bytes
Binary file not shown.

Diff for: dist/protobuf.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)