promise-arrays icon indicating copy to clipboard operation
promise-arrays copied to clipboard

Performance?

Open vitaly-t opened this issue 8 years ago • 1 comments

I believe you know that operations like map and filter are used all the time on large data sets. Their performance is critical, and thus highly optimized by any JavaScript engine.

What you might not know, is that within the realm of promises, new Promise() is the heaviest and the longest operation, in any promise library. Even Petka Antontov, the author of Bluebird wrote there was only so much he could do, that operation will remain the heaviest in any promise library.

And you introduce new Promise() inside each step within the map and filter callbacks. You should know this will make those methods unusable for processing large data sets. They will be way too slow.

vitaly-t avatar Sep 11 '15 08:09 vitaly-t

@vitaly-t Thanks for the information, I just learned about that yesterday (literally) when my application crashed while processing a large dataset. On the bright side, this project is an Open Source project, so you are certainly most welcome to suggest any improvements and changes, or add them yourself, which will benefit everybody.

sallar avatar Sep 11 '15 12:09 sallar