javascript - How to profile meteorjs performance -
i have meteor.js app offers chat rooms. suddenly, when switching rooms, chat loads (50 messages) extraordinarily slow. takes multiple seconds 50 messages, can see them popping in 1 one. on local machine, developer database few entries.
now, problem much less visible in chrome suspect it's client-side issue. however, don't know begin debugging this. template populated many times, each time few more messages last.
using safari profiler shows me _.foreach, deep phone call tree of minimongo functions consuming 32% of total cpu time, (idle) consuming 35% , (program) consuming 16%.
i looking kadira. looks should able help me thing can create show me "rooms" slowest cubscription 12ms. messages not stored in rooms, separate collection each message containing room id.
i know bit of vague question wondering options performance profiling of meteor apps in general, guess.
recently faced same issue , wanted debug client side msgs , query updates.there no official tool client side think. can debug follows in local environment. have used meteor 0.8.2 version.
you can track client side minimongo updates , sockjs message transfers using minimongo , livedata meteor core packages.
meteor not allow alter files in core packages. re-create , paste 2 packages folders meteor core in project packages folder.
now core packages replaced local packages. can add together console.log functions got high execution time.
as per findings high heaps triggered in next files.and have logged points per code in paste bin.
i. packages/livedata/livedata_connection.js : http://pastebin.com/zsxim0ij ii. packages/minimongo/minimongo.js : http://pastebin.com/fap0sfqs iii packages/livedata/sockjs-0.3.4.js : http://pastebin.com/kiwn0ybx
you can replace files pastebin content if using same meteor version.
to monitor ddp msg transaction client outside can utilize nice tool. https://github.com/arunoda/meteor-ddp-analyzer
i guess kadira working on creating client side monitoring tool. hope problems sorted then.
javascript meteor profiling
No comments:
Post a Comment