Simple console timing shows that fb loads much slower than desired (just 50 chat items).
load: 171.226ms
fbload: 1723.570ms
load: 182.672ms
fbload: 2143.836ms
The normal load is from my mongodb and fbload is firebase. Despite my mongo being not denormalized fb is order of magnitude slower.
Is there something I can do to increase performance?
I'm using angularfire and I can load the initial from my own database and then replace it with the fb data. For this solution is there some way I can get the fb data to sync and bind onto existing dom elements as to avoid repainting the layout?
Code This is how I'm benching the fb time.
console.time('fbload')
$scope.chatLog = $firebase(fb.child('view/r/' + id).endAt().limit(50));
$scope.chatLog.$on('value', function () {
console.timeEnd('fbload')
})
Edit:
My guess is that this is due to the websocket handshake. Firebase should initially just use xhr to get the data and only rely on websockets after connection. Still this needs a solution. Any ideas?