Skip to content

Remove protobufjs in favor of protons-runtime - #60

Open
v1rtl wants to merge 35 commits into
ipld:mainfrom
v1rtl:remove-protobufjs
Open

Remove protobufjs in favor of protons-runtime#60
v1rtl wants to merge 35 commits into
ipld:mainfrom
v1rtl:remove-protobufjs

Conversation

@v1rtl

@v1rtl v1rtl commented Feb 8, 2025

Copy link
Copy Markdown
Contributor

This closes #31

Switches to protons-runtime

All tests pass now

Comment thread package.json Outdated
@alanshaw

Copy link
Copy Markdown
Member

@talentlessguy you might gain more savings switching to protons and protons-runtime instead? It would dudupe with protons-runtime in ipfs-unixfs-exporter.

@alanshaw

Copy link
Copy Markdown
Member

Note: I think in general I'd prefer to switch to protobuf-es as it seems to have a big community and usage behind it.

@v1rtl

v1rtl commented Feb 10, 2025

Copy link
Copy Markdown
Contributor Author

@talentlessguy you might gain more savings switching to protons and protons-runtime instead? It would dudupe with protons-runtime in ipfs-unixfs-exporter.

thanks for the suggestion

@achingbrain

Copy link
Copy Markdown
Member

FWIW, last time I ran the benchmark suite, protons was just over 20% faster than protobuf-es when serializing/deserializing - https://github.com/ipfs/protons/tree/main/packages/protons-benchmark#usage

These kind of performance characteristics are very important to high traffic deployments like Lodestar so it's unlikely to be switched away from elsewhere.

@v1rtl

v1rtl commented Feb 21, 2025

Copy link
Copy Markdown
Contributor Author

FWIW, last time I ran the benchmark suite, protons was just over 20% faster than protobuf-es when serializing/deserializing - https://github.com/ipfs/protons/tree/main/packages/protons-benchmark#usage

do you mean protobufjs, and not protons?

@achingbrain

Copy link
Copy Markdown
Member

No, I mean protons:

image

protobuf.js is also quite a bit faster than protobuf-es but it's CJS and the stack is ESM-only so that rules it out.

@v1rtl

v1rtl commented Feb 22, 2025

Copy link
Copy Markdown
Contributor Author

I wonder how hard it would be to replace protobuf-es with protons, will give it a shot rn

@achingbrain

Copy link
Copy Markdown
Member

I guess the only thing is that protons compiles protobuf definitions to TypeScript and this is still a js project.

@v1rtl v1rtl changed the title Remove protobufjs in favor of protobuf-es Remove protobufjs in favor of protons-runtime Feb 22, 2025
@alanshaw

alanshaw commented Apr 3, 2025

Copy link
Copy Markdown
Member

@achingbrain is the benchmark encode or decode? We're only encode in this repo.

@v1rtl
v1rtl marked this pull request as ready for review May 19, 2025 19:15
@v1rtl
v1rtl requested a review from alanshaw May 19, 2025 19:15
Comment thread src/codec.js Outdated
Comment thread buffer-shim.js
Comment thread src/codec.js
Comment thread src/codec.js Outdated
@v1rtl

v1rtl commented Aug 5, 2025

Copy link
Copy Markdown
Contributor Author

Had to remove certain dead code that apparently was detected before to make CI pass (otherwise the coverage is too low). Should I open a separate PR to eliminate all dead code? To make it easier to review the current PR

@v1rtl
v1rtl requested a review from 2color August 5, 2025 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove dependency on protobufjs

4 participants