Choosing a node.js library with pure js vs C++ add on implementation
PS: App needs to be hosted in Heroku
Assuming that the libraries are functionally similar, I can think of a couple pros and cons:
- Generally faster than a pure JS implementation (this may not always be true--always test yourself)
- Ability to do CPU-intensive work asynchronously in the thread pool
- May not compile on all platforms, usually happens when the addon requires some third-party libs
- May be harder to debug/fix problems (depending on your level of expertise in C++/V8)
If you would prefer to use the C++ addon but are concerned about it not running on Heroku, create a small test app that uses it and deploy it. If you would prefer to use the JS lib but are concerned about speed, you'll really need to do your own real-world performance testing to see if it's actually an issue.