CrabDude / trycatch

An asynchronous domain-based exception handler with long stack traces for node.js
MIT License
246 stars 17 forks source link

Performance concerns #21

Closed pocesar closed 11 years ago

pocesar commented 11 years ago

I haven't tried the module in-depth yet, nor performed serious benchmarks on it, but would this affect a framework if wrapped most of user generated code (controllers, views, routes) even if no exceptions were being thrown? I know the common sense to avoid common pitfalls, like executing the try/catch inside a loop or recreating it over and over in async calls, but on parts that would expect an exception but most of the time wouldn't, how would it perform?

CrabDude commented 11 years ago

trycatch's affect on performance will be marginal with long-stack-traces turned off. Also, even though trycatch is wrapping core calls and shimming callbacks, there will be a net performance gain from avoiding unnecessary restarts to your process, which depending on the size of your process and cluster implementation can be a significant performance gain.

pocesar commented 11 years ago

nice!