I made a test.
// both client and server
Messages = new Mongo.Collection('messages');
// server
if(Messages.find().count() === 0) {
for(let i = 0; i < 10000; i++) {
Messages.insert({
text: 'Message ' + i,
});
}
console.log('Inserted 10000 messages.');
}
Meteor.publish('messages', function() {
return Messages.find();
});
// client
Meteor.startup(() => {
const sub = Meteor.subscribe('messages');
const time = new Date().getTime();
Tracker.autorun(() => {
console.log(Messages.find().count(), new Date().getTime() - time);
if(sub.ready()) {
console.log(Messages.find().fetch());
}
});
});
Here is the console output:
main.js:123 0 3
main.js:123 1865 1246
main.js:123 2096 1293
main.js:123 5199 1872
main.js:123 10000 2367
main.js:126 [Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object…]
So the 10 000 documents were steamed to the client, the total loading time was ~2 seconds and the first batch of documents was available in ~1 second.