1

So thanks to all of you meteor pros out there I finally managed to properly transform my app from using the autopublish package to a proper publish/subscription based app. Thanks a lot for all your help!!

Link to my app: Questful Test

Problem is that for some reason my app is now a lot slower with the pub/sub model in place than before were I still used the autopublish package. A lot of data comes down the wire significantly slower than before which is of course not beneficial for the user experience.

Is this behaviour normal or why is this? I can of course provide you with code snippets if you tell me which ones you need ... right now I do not know which parts of my code would help you helping me! :-)

EDIT: Here you can see parts of my pub/sub code: LINK

Please note: Following @HubertOG's answer, I implemented the whole _dep Dependencies stuff as well. The data is now loaded everytime but again, it is a lot slower than with autopublish. How do you guys structure your app? Where (in which file/folder, in which part of the code) do you put your Deps.autorun() stuff with the subscriptions in it?

Cheers! Patrick

Community
  • 1
  • 1
Patrick DaVader
  • 2,133
  • 4
  • 24
  • 35
  • 1
    That does not sound normal, because essentially the only thing that autopublish does is set them all up for you. Perhaps it's because you have a lot more data now? Why don't you post your pub/sub code so we can check that out? – BenjaminRH Aug 14 '13 at 01:33
  • This is completely not normal. With autopublish, all data stored in collections available on both server and client are downloaded to the client. So, more data you have, slower it will be. With pub/sub you can limit the data returned to the client, so it should be faster in that case. I use it on my app when i had to much data sent to the client. And i then just added a "Load More" button to allow the user to download more data. But with that system, my app that became slow with huge data, has just become fast again. – Rebolon Aug 14 '13 at 16:48
  • I don't see anything in the code you posted that would explain the slow loading speed, although I did leave an answer there. Are you able to show more code? Specifically, the publish functions on the server and if you have any other subscribe functions. – BenjaminRH Aug 14 '13 at 19:27
  • There is nothing fancy about my publish functions. They are in the /server/server.js inside a Meteor.startup(). I've got one publish function per collection (4 in total) which basically only take one or two arguments (Session vars "ehash" or "ghash") and then return a part of the collection. So really the publish functions are all just one liners which return parts of the corresponding collection. that's it. – Patrick DaVader Aug 14 '13 at 21:02
  • another thing: When you try out our online version on the meteor server (first link) ... does it feel slow to you? with autopublish on the events showed up instantly, even online but now it takes abou 1 sec to load them. Is this normal? – Patrick DaVader Aug 14 '13 at 21:24
  • 1
    That doesn't actually seem slow to me. I assumed that was an earlier version with autopublish so it would be speedy. If you're talking about delays of around one second, that is normal. – BenjaminRH Aug 14 '13 at 21:38

0 Answers0