bufferutil icon indicating copy to clipboard operation
bufferutil copied to clipboard

Can this be replaced by webassembly version?

Open lygstate opened this issue 3 years ago • 8 comments

lygstate avatar Nov 23 '22 20:11 lygstate

Yes, probably, but it must be faster otherwise it does not make sense.

lpinca avatar Nov 24 '22 19:11 lpinca

Yes, probably, but it must be faster otherwise it does not make sense.

It's make sense when I wanna webpack ws, does not needs to be faster, equal performance is enough

lygstate avatar Nov 24 '22 19:11 lygstate

You can connect native modules with webpack.

lpinca avatar Nov 24 '22 19:11 lpinca

You can connect native modules with webpack.

The webpack result are not portable, for example, it's can not running under both windows/linux/osx

lygstate avatar Nov 24 '22 19:11 lygstate

The webpack result are not portable, for example, it's can not running under both windows/linux/osx

I think you can produce different bundles picking the correct prebuilt binary and use the correct bundle at runtime. I see your point but I'm not sure if it is a common use case.

lpinca avatar Nov 24 '22 19:11 lpinca

The webpack result are not portable, for example, it's can not running under both windows/linux/osx

I think you can produce different bundles picking the correct prebuilt binary and use the correct bundle at runtime. I see your point but I'm not sure if it is a common use case.

cross-compiling is a nightmare, for example for windows, we have MSVC,GNU,Electron, for Linux we have MUSL,GLIBC and different architecture

lygstate avatar Nov 25 '22 04:11 lygstate

There are already prebuilt binaries for Windows, macOS, and Linux (glibc) that cover 99% of use cases. Anyway feel free to open a PR.

lpinca avatar Nov 25 '22 07:11 lpinca

To me this seems to be a perfect wasm-simd candidate.

jerch avatar Apr 21 '23 08:04 jerch

The js version can be made significantly faster, if needed. This likely doesn't need a webassembly version

ChALkeR avatar Oct 31 '25 20:10 ChALkeR

See https://github.com/tsctx/ws-masking for a WebAssembly variant.

lpinca avatar Oct 31 '25 20:10 lpinca

Yeah, that also has an optimized pure js impl which is much faster than simple one. It's unpublished from npm though.

ChALkeR avatar Oct 31 '25 23:10 ChALkeR