mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	performance: Avoid Recipient lookup for stream messages.
All the fields of a stream's recipient object can be inferred from the Stream, so we just make a local object. Django will create a Message object without checking that the child Recipient object has been saved. If that behavior changes in some upgrade, we should see some pretty obvious symptom, including query counts changing. Tweaked by tabbott to add a longer explanatory comment, and delete a useless old comment.
This commit is contained in:
		@@ -1194,7 +1194,7 @@ class StreamMessagesTest(ZulipTestCase):
 | 
			
		||||
                body=content,
 | 
			
		||||
            )
 | 
			
		||||
 | 
			
		||||
        self.assert_length(queries, 14)
 | 
			
		||||
        self.assert_length(queries, 13)
 | 
			
		||||
 | 
			
		||||
    def test_stream_message_dict(self) -> None:
 | 
			
		||||
        user_profile = self.example_user('iago')
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user