Zulip 服务器和 Web 应用程序。开源团队聊天可帮助团队保持高效和专注。
Go to file
Tim Abbott bfaa698ea6 get_old_messages: Don't fetch messages from database unless we have to.
Previously, we were fetching Message.objects.select_related() from the
database, even if we actually ended up fetching the message dicts from
memcached and thus not actually using them.  Especially in the cached
case, this resulted in a lot of overhead where the Django ORM put
together Message objects with lots of data in them that were never
used.  This commit switches the model to only fetch the full message
objects from the database for those messages which are not found in
the memcached caches.

Here are the timings for get_old_messages before this patch was applied:

(cached)
127ms (db: 42ms/2q) /json/get_old_messages (starnine@mit.edu via website)
385ms (db: 105ms/1q) /json/get_old_messages (starnine@mit.edu via website)

(uncached)
315ms (mem: 6ms/41) (db: 90ms/22q) /json/get_old_messages (starnine@mit.edu via website)
507ms (db: 94ms/14q) /json/get_old_messages (starnine@mit.edu via website)

Here are the timings for get_old_messages after this patch was applied:

(cached)
 80ms (db: 9ms/2q) /json/get_old_messages (starnine@mit.edu via website)
133ms (db: 4ms/1q) /json/get_old_messages (starnine@mit.edu via website)

(uncached)
230ms (mem: 9ms/41) (db: 48ms/23q) /json/get_old_messages (starnine@mit.edu via website)
385ms (db: 55ms/15q) /json/get_old_messages (starnine@mit.edu via website)

(imported from commit c4748513392a906393314aa7cd41d98a69865411)
2013-05-02 15:32:23 -04:00
api Implement Humbug SVN integration. 2013-05-01 11:37:07 -07:00
assets favicon: Add an 'infinite' favicon for more than 99 messages 2013-02-15 16:18:24 -05:00
bots [manual] feedback-bot: Include sender domain in feedback messages. 2013-05-02 15:32:04 -04:00
certs Add wildcard certificate for *.e.humbughq.com. 2013-01-17 18:56:39 -05:00
confirmation [third]: Accept and pass along gafyd_name parameters to confirmation templates. 2013-04-24 12:03:41 -07:00
humbug api_key is url parm for jira webhook 2013-04-30 18:14:11 -04:00
node_modules Import Handlebars compiler and dependencies 2013-04-02 14:43:58 -04:00
servers Create aggregate all-active-users data 2013-05-01 17:24:38 -04:00
templates Show lock icon in compose box for invite-only streams (811) 2013-05-02 13:39:34 -04:00
tools Mark messages as read when using the End key 2013-05-01 17:26:19 -04:00
zephyr get_old_messages: Don't fetch messages from database unless we have to. 2013-05-02 15:32:23 -04:00
.gitignore gitignore: Add .DS_Store 2013-02-06 16:31:55 -05:00
manage.py chmod +x manage.py 2012-10-25 15:22:18 -04:00