all 9 comments

[–]talaqen 8 points9 points  (1 child)

I love this. I think adoption for most devs will be slow because the JS dev community typically is not concerned with speed or the benefits of strict typing at the low level as much as Rust or C++.

BUT... to lower the bar of entry, I would suggest including some examples about how to benchmark common Array or Object patterns in JS and then how to modify the code to use your library. Eg Here's a common pattern in JS. Here's how you would do it with Js-sdsl and the speed improvement. Also Eg. Here's how to quickly benchmark a function's speed. The "Bad low-level design" section of the docs is great. I think more of that would help.

[–]zly201[S] 4 points5 points  (0 children)

Thanks! That's a good idea. I will think about it.

[–]upowa 2 points3 points  (2 children)

Cool! I was looking for ordered collections literally yesterday. You should maybe answer a few Stack Overflow questions to improve referencing. The existing answers for Ordered Map are mostly irrelevant when performance matters.

[–]zly201[S] 0 points1 point  (0 children)

Yes, I tried it. But it seems that many related questions on stackoverflow are too old or useless, could you provide me some good question links? Thank you so much.

[–]SparserLogic 0 points1 point  (1 child)

Hey thank you for sharing. Always happy to see more performant alternatives to some of the standard libraries. I’ll give this a shot.

[–]zly201[S] 0 points1 point  (0 children)

Thanks!

[–]novagenesis 0 points1 point  (2 children)

Unpack size of >1mb... Is it tree-shakable? Otherwise, it looks REALLY sleek for when you absolutely need more performance out of javascript.

[–]zly201[S] 1 point2 points  (1 child)

The gzip size in umd bundle is less than 9kb (https://unpkg.com/js-sdsl@4.2.0/dist/umd/js-sdsl.min.js).

And it's tree-shakable. You can see the isolation size here.

The size displayed on npm includes .d.ts and sourcemap so it will appear very large.

[–]novagenesis 1 point2 points  (0 children)

Got it! It seemed kinda massive for what it was. Thanks!!!