Created
September 14, 2016 10:26
-
-
Save averas/01c00259465a6f66d1212dd3d4617c57 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var stream = require('getstream'); | |
client = stream.connect('key', 'secret', 'id', { location: 'eu-central' }); | |
var feed = client.feed('user', 'foobar'); | |
var counter = 20; | |
var results = []; | |
function fetchFeed() { | |
var start = new Date().getTime(); | |
feed.get({limit:20}).then(function(data) { | |
results.push(new Date().getTime() - start); | |
process.stdout.write("."); | |
if (counter-- > 0) | |
fetchFeed(); | |
else | |
console.log((results.reduce(function(a, b) { return a + b; }) / results.length) + "ms"); | |
}); | |
} | |
fetchFeed(); |
we already support this server side and on some clients. The Python client for instance does false start and reuses the connection making the SSL only free. We should be able to get similar results with the node client (researching on this right now)
Cool! Great job identifying the issue so fast!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alright. But this is relevant for all of your client libraries I guess? Have you looked at some of the ways to decrease SSL latency, such as false start and resumption (https://istlsfastyet.com/)? I imagine many of your clients being returning clients (as long as we're talking backend servers) meaning such approaches could be quite beneficial.