Reputation: 79
What are the pros and cons of choosing a pure js library over a library with some C++ code ? ex. timezone-js(pure js) over node-time(cpp addon) for date with timezone support.
PS: App needs to be hosted in Heroku
Thanks
Upvotes: 0
Views: 515
Reputation: 14633
An all-Javascript solution is easier to maintain and deploy.
One would use a C++ module instead in case:
Since node-time isn't CPU-intensive, and a Javascript alternative exists, I recommend the simpler solution, which in this case is timezone-js.
Upvotes: 1
Reputation: 159105
Assuming that the libraries are functionally similar, I can think of a couple pros and cons:
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.
Upvotes: 2