Switch promises to bluebird
00christian00 opened this issue · 1 comments
It seem even in the latest version promises are still very slow :
http://softwareengineering.stackexchange.com/questions/331991/are-native-promises-still-slower-in-node-vs-libraries-such-as-bluebird/331992#331992
How about switching to bluebird?
Or allow an optional parameter so users can pass the module if they installed it:
something like :
var P = Promise;
function TarantoolConnection (options){
this.socket = new net.Socket({
readable: true,
writable: true
});
..... etc
if(options.bluebird!==undefined) P=bluebird;
}
Then in the client code you would have something like:
var BlueB= require('bluebird');
var conn = new TarantoolConnection({
bluebird:BlueB,
host: 'localhost',
port: 3301});
This way you can leave almost everything else same.
It's cool but in my tests it's not a really bottleneck. I have some troubles with a handling a lot of responses right now and search for some way to do it right. Iproto is not a pipelining protocol so server can send answer to my requests in any sequences.
https://github.com/KlonD90/node-tarantool-driver/tree/v2.0 som WIP here and today i do some improvements and fixes for this version and release it.