rodhoward / node-sybase

23 stars 55 forks source link

Slow service #29

Open AnteraTres opened 4 years ago

AnteraTres commented 4 years ago

Good morning!

I'm trying to use this module for a Sybase conection with 3 different dbs. The service has to look for a record on the 3 Sybase dbs, and the first one that answers with a record ends the process. But the problem here is that is getting almost 300ms for each db. I'm trying to fix it but maybe is just the JAR file ¿Can anyone share their times of response so i can tell that it's not a module problem? ¡Thanks!

theneva commented 4 years ago

I completely missed this one, sorry.

That sounds really strange. I don't think the owner of this repo has access to a Sybase instance anymore, and neither do I, so any feedback/data will have to come from the community.

One question, though: How have you tested this?

When you call connect, you have to wait for a JVM to spawn (see https://github.com/rodhoward/node-sybase/blob/master/src/SybaseDB.js#L31)

If you're benchmarking by running only one query, I guess it would seem like that query takes JVM startup time + connection time + query time. It sounds reasonable to me that this comes in to 300-ish milliseconds.

Could you do another test where you call connect for each DB instance you're using first, and then run your queries a bunch of times to find the average duration of the queries?