invertase / denque

The fastest javascript implementation of a double-ended queue. Used by the official Redis, MongoDB, MariaDB & MySQL libraries for Node.js and many other libraries.
https://docs.page/invertase/denque
Apache License 2.0
354 stars 33 forks source link

Get rid of ES6 stuff #4

Closed sushantdhiman closed 7 years ago

sushantdhiman commented 7 years ago

We would like to use denque in node-mysql2, but its currently using ES6 stuff which doesn't work with older Node versions.

Do you agree to remove ES6 stuff ? Library is pretty simple which I think can be converted to ES5 without much efforts

Salakar commented 7 years ago

@sushantdhiman - Converted the whole project - didn't take as long as I thought it would ;p v1.1.0 is now all ES5 - so just require as normal now.

https://travis-ci.org/Salakar/denque/builds/168297121

Closing issue.

FallingSnow commented 7 years ago

Doesn't let and const provide better performance than var?

sushantdhiman commented 7 years ago

@FallingSnow It entirely depends upon use case. const and let both are scope bound, using them in loops can be heavy. In general there is not much performance difference. Converting to ES5 have opened this library for old node versions like 0.10, I think thats more important because many env are still running on theses old node versions.

Salakar commented 7 years ago

@FallingSnow marginal and only in some cases better whilst in other cases its really bad, for example let compound assignments currently de-opt parent function in v8 environments.

But this change was done to allow old node support, nothing else. Performance stayed the same.