fast-bitset icon indicating copy to clipboard operation
fast-bitset copied to clipboard

Consider rewriting to native ES6

Open mattkrick opened this issue 9 years ago • 6 comments

The latest version of V8 can optimize functions that have let and const. This should provide some performance gain. Node 4.2+ takes it just fine, as does Chrome & Firefox nightly. Still waiting on Firefox & webkit to catch up.

mattkrick avatar Dec 07 '15 02:12 mattkrick

Should you do this, I hope you consider adding an es5 compatibility build by transpiling with a tool like Babel!

jamesplease avatar Dec 07 '15 03:12 jamesplease

no worries, I wouldn't do it until every browser natively supports all features. guys who dont ship compatible builds are jerks ;)

mattkrick avatar Dec 07 '15 03:12 mattkrick

I'd love this, not only in the browser, but for supporting es6 imports during bundling with webpack/rollup. I'm only going to use a handful of these functions, so it'd be awesome to only import the ones I need. Not that 24k is huge... I just don't like bundling unused code for every dependency I include.

micahscopes avatar Oct 16 '17 18:10 micahscopes

@jmeas that'd be awesome too! it's very easy to create multiple outputs with rollup. i have a project that creates an mjs output for the browser and a js output for node.

micahscopes avatar Oct 16 '17 18:10 micahscopes

@micahscopes i'd be up for a PR but I don't have the bandwidth right now. To incorporate the modules, i'd suggest something like https://philipwalton.com/articles/deploying-es2015-code-in-production-today/ for a graceful fallback.

mattkrick avatar Oct 16 '17 19:10 mattkrick

At the moment, I don't have time either, but I might in the next few months. I'll keep it in mind...

micahscopes avatar Oct 16 '17 20:10 micahscopes