I have a node.js canvas app that queries salesforce for accounts and there are only 10 of them , but for some reason it takes about 4-5 seconds before the response comes back. I have used both nforce and node-salesforce modules for this and both are taking the same time.
Example code:
nforce
var query = 'SELECT Name, Id FROM Account';
org.query(query, auth, callback(err, resp) {
if(!err) console.log(resp)
});
and node-salesforce
conn.query("SELECT Id, Name FROM Account", function(err, result) {
if (!err) { return console.log(result); }
});
The auth details are already recorded, so no login is required.
I have tried calling other APIs and again it takes 4-5 seconds.
Cheers
time curl -H 'X-PrettyPrint: 1' -H 'Authorization: Bearer ACCESS_TOKEN' https://na15.salesforce.com/services/data/v26.0/query/?q=SELECT+Name,Id+FROM+Account. Over 10 runs, the average time was about 0.5s. How long does curl take for you? – metadaddy♦ Feb 7 at 5:49