3 ms·
Because it's the foundation of all modules and if you start of on the wrong path it can only get worse. On a daily basis I'm working on web applications with m
by sorenso 12y ago
Because it's the foundation of all modules and if you start of on the wrong path it can only get worse.
On a daily basis I'm working on web applications with more than 5000 req/sec, so it's important to make sure your code performs.
- stupidcar 12y agoOhhh, I was confused because I know Node caches module objects, but I see the code in the V1 case is creating a new function each time it's used. Seems like it's not really a module issue per se though, just a general JS best practice.
- sorenso 12y agoYes, version 1 is using closures which creates a new function every time the function is called. I've seen this pattern in many places and even used it myself :) -sorenso-