joyent/node — Issue #2597: net.createConnection vs new Socket() performance on Linux
Author: Cowboy-coder
Created: 2012-01-23 14:03:12+00:00
State: open

When calling `new Socket()` followed by `socket.connect(...)` the performance on Linux systems are like 10x slower compared to just using `net.createConnection(...)`.
The difference was noticed in https://github.com/christkv/node-mongodb-native/issues/445 and in https://github.com/marcello3d/node-mongolian/issues/79 (both MongoDb drivers.)

This might be an issue only reproducible when creating socket connections to MongoDb, but at least to me this seems a bit odd and might be a bug in node.js. It looks to me like they do pretty much the same thing internally?