Comments (6)
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.
Pull request invited !
from idna.
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.
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.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from idna.