Giter Club home page Giter Club logo

Comments (6)

lemire avatar lemire commented on June 27, 2024 1

Each process instantiates a WebAssembly module that includes ada

Even processes that do not need ada? How is ada different, as a library, from any other library like, say, libicu, libzstd or libssh? Or the rust-url library for example?

As far as I know, ada/idna is the most compact library available currently with this functionality.

I am going to close this. You are invited to provide code or specific actionable advice on how to make this library smaller. A pull request would be appreciated.

from idna.

lemire avatar lemire commented on June 27, 2024

Pull request invited !

from idna.

lemire avatar lemire commented on June 27, 2024

The binary should be about 280KB. For context, ICU (a standard dependency which we avoid) is over 40 MB or nearly 150 times larger.

from idna.

d3lm avatar d3lm commented on June 27, 2024

Yes that's true. ICU is a lot bigger. I don't know from the top of my head how we could avoid that "bloat", except for relying on host functionality if compiled to Wasm / WASI. So that we don't have to include the tables, and toUnicode and toAscii is something that could be provided by the host?

from idna.

lemire avatar lemire commented on June 27, 2024

After standard compression, the entire ada library (including idna) is well under 200 KB. The compressed WASM is about 100 KB. This is much less than the JavaScript aggregation of most websites. A typical website these days require megabytes of downloads (with caching, of course). It is much, much smaller than ICU which is already almost everywhere.

Except for relying on host functionality if compiled to Wasm / WASI. So that we don't have to include the tables, and toUnicode and toAscii is something that could be provided by the host?

What is contained in your host?

Ada (in its entirety) is distributed with every version of Node.js. Why don't you just distribute ada as binary?

If you are concerned with the 100KB WASM download and you cannot install ada locally, why don't you cache it?

from idna.

d3lm avatar d3lm commented on June 27, 2024

Yea, the reason I am mostly concerned is not the compressed size. It's small as you said, but for us, we have a multi-process architecture, and userland can spawn any number of processes or threads. Each process instantiates a WebAssembly module that includes ada, which means every process has to parse it, and every process then basically includes its own set of mapping tables. But there is also no standard Web API that we could use to provide toUnicode or toAscii other than implementing this in JS and that would also mean we'd have to have some mapping tables in every process as well.

from idna.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.