Improvements to mod_muc_room
ESL Developer Blog - - September 11, 2009Because I am currently in the process of coupling mod_muc to our web-application-server I need to bind mod_muc to the permission-system that we have online (that is rewriting of mod_muc_room:get_affiliation/2 and :get_role/2.
During testing of the functionality i found, that these to functions are being called VERY often. I further looked into the case and found some instances where these functions are being called before passing some rather trivial checks (like whether the room is public or not). This was rather nasty because fetching a list of a few hundred rooms and then asking the role and affiliation for each room NINE times is pretty harsh on the web servers.
So I shifted some code around and was able to reduce the number of calls to these functions (for the “disco”-case) to TWO.
i stripped the code of all other modifications and it is included as an attachment to this post. Since i guess it is relevant how often you call the database with mnesia as well, I thought I’d share it. Code is “untested”, serves my purpose and should not be very error-prone, since it is basically just a refactoring of the functions handle_sync_event and process_iq_disco_items.
Get it here: mod_muc_room
Categories: Blogs ESL Developer Blog
Comments
No comments so far, you could be the first.Add comment
Erlang on Twitter
» tichise (Takuya Ichise): RT @AntiBayes: 【言語別業務時の服装】
・Clojure:全裸
・Scheme:全裸
・Gauche:全裸
・Prolog:全裸
・Scala:全裸
・Erlang:全裸
・C++:全裸
» mshiba64 (Masami Shibatani): ということで、ErlangのBit Syntaxに突入。language for distributed and concurrent programだからね。
» despenjahatdos (Jon champion): Eits jangan salah begini2 saya titisan dewa erlang RT @yolapitalokaa: Yg ngepost twit kyknya jg lg galau drtd ... http://t.co/QfCyVSIl
» erlangtriaji (erlang triaji ): Sini sun ahahaha RT @Encays: Udah udah, lo berduaan aja RT @revianh: Kepooo! RT @erlangtriaji: Hadir RT @Encays: Udah, sama erlang aj
» Encays (antarif cahyadi): Menjepit RT @erlangtriaji: Tegang! RT @revianh: Kepooo! RT @erlangtriaji: Hadir RT @Encays: Udah, sama erlang aja RT @revianh
» erlangtriaji (erlang triaji ): Tegang! RT @revianh: Kepooo! RT @erlangtriaji: Hadir RT @Encays: Udah, sama erlang aja RT @revianh: Nanggepnya lama banget
» Encays (antarif cahyadi): Udah udah, lo berduaan aja RT @revianh: Kepooo! RT @erlangtriaji: Hadir RT @Encays: Udah, sama erlang aja RT @revianh: Nanggepnya lama
» revianh (Revian Hermansyah): Kepooo! RT @erlangtriaji: Hadir RT @Encays: Udah, sama erlang aja RT @revianh: Nanggepnya lama banget -_-
» erlangtriaji (erlang triaji ): Hadir RT @Encays: Udah, sama erlang aja RT @revianh: Nanggepnya lama banget -_-
» Encays (antarif cahyadi): Udah, sama erlang aja RT @revianh: Nanggepnya lama banget -_-
Statistics
Number of aggregated posts: 10454
Number of comments: 1392
Most recent article: January 31, 2012
Latest comments
» nobelboy on OpaDo Data Storage: Feel free to add some Qs here or contact me offline, and I will see what I can work into…
» darrensy on The Twisted Matrix: This has been a great idea you have shared. covers for kindle
» jony on Principle Software Engineer at LonoCloud (Full-time): That provides will become a internet marketer of little kinds of expert methods developers developing strategy using Erlang/OTP. There will…