Skip to content
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

[Web] onnxruntime-node Linux addon binaries contain duplicate identical copies of libonnxruntime.so.x taking up extra ~40MB #23956

Open
rotemdan opened this issue Mar 8, 2025 · 1 comment
Labels
platform:web issues related to ONNX Runtime web; typically submitted using template

Comments

@rotemdan
Copy link

rotemdan commented Mar 8, 2025

Describe the issue

Linux (x64):
Image

Linux (arm64):
Image

I tested the files libonnxruntime.so.1 and libonnxruntime.so.1.21.0 are identical. On 1.21.0, SHA256 hashes:

x64:

05BFDDEEFC536A44478C20226218DAE8853995518BB2A994B4FA15A996F5F412

arm64:

36671B53885A8433882C4DB360138BD060F3580F7D7CB6578050E755E83B6128

This duplication seems to have started in 1.19.0. It's not there in 1.18.0

Image

Can anything be done to reduce that extra ~40MB from the installed package size? Is it necessary?

I guess the gzip compression could with the npm (downloaded) package size, but I thought I should report this since I haven't seen it reported before (sorry if this is a duplicate).

To reproduce

See:

https://www.npmjs.com/package/onnxruntime-node/v/1.21.0?activeTab=code

Urgency

No response

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

1.21.0

Execution Provider

Other / Unknown

@rotemdan rotemdan added the platform:web issues related to ONNX Runtime web; typically submitted using template label Mar 8, 2025
@rotemdan
Copy link
Author

rotemdan commented Mar 9, 2025

Alright, I've made an experiment to see the reduction in npm .tgz archive size with and without duplicates:

I've ran:

npm pack onnxruntime-node

Which resulted in a 78,144KB .tgz file.

Then I extracted it, removed the duplicates and ran:

tar -czvf x.tgz onnxruntime-node-1.21.0

Which resulted in a 62,674KB archive (62,512KB with maximum compression level).

Image

So by removing the duplicates, the reduction in size in the compressed archive is about 15.4 MB, which is about 20% of original.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:web issues related to ONNX Runtime web; typically submitted using template
Projects
None yet
Development

No branches or pull requests

1 participant