-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Per-message/enum file output #44
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Benchmark results:yarn run v1.22.19
$ yarn bench:prepare && yarn bench:run
$ node bench/prepare.js
Generating AssemblyScript protobuf file...
Building AssemblyScript bench file...
$ node bench/index.cjs
benchmarking encoding performance ...
as-proto x 1,037,910 ops/sec ±0.97% (84 runs sampled)
protobuf.js x 408,434 ops/sec ±1.48% (82 runs sampled)
JSON x 339,113 ops/sec ±1.24% (84 runs sampled)
google-protobuf x 282,798 ops/sec ±1.51% (83 runs sampled)
as-proto was fastest
protobuf.js was 60.8% ops/sec slower (factor 2.6)
JSON was 67.4% ops/sec slower (factor 3.1)
google-protobuf was 72.9% ops/sec slower (factor 3.7)
benchmarking decoding performance ...
as-proto x 747,803 ops/sec ±1.45% (87 runs sampled)
protobuf.js x 1,112,705 ops/sec ±1.16% (86 runs sampled)
JSON x 367,301 ops/sec ±1.29% (85 runs sampled)
google-protobuf x 267,876 ops/sec ±1.23% (88 runs sampled)
protobuf.js was fastest
as-proto was 33.0% ops/sec slower (factor 1.5)
JSON was 67.0% ops/sec slower (factor 3.0)
google-protobuf was 75.9% ops/sec slower (factor 4.2)
benchmarking combined performance ...
as-proto x 452,167 ops/sec ±1.29% (87 runs sampled)
protobuf.js x 315,569 ops/sec ±1.79% (84 runs sampled)
JSON x 164,277 ops/sec ±1.38% (85 runs sampled)
google-protobuf x 111,215 ops/sec ±1.03% (87 runs sampled)
as-proto was fastest
protobuf.js was 30.5% ops/sec slower (factor 1.4)
JSON was 63.7% ops/sec slower (factor 2.8)
google-protobuf was 75.3% ops/sec slower (factor 4.1)
Done in 74.73s. |
@piotr-oles I will check this. Thanks for letting me know! |
🚀 PR was released in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With this PR, the
as-proto-gen
package has made a change in the way it nests messages in the output. Instead of using namespace, it will now generate a separate.ts
file for each message or enum, and use ESM modules to connect them. This update brings better compatibility with current web practices and helps to avoid excessively large output files.