Closed pawl-bb closed 5 years ago
Currently CeleryEmailBackend.send_messages works like this:
CeleryEmailBackend.send_messages
email_to_dict
Serializing all the e-mails at once can use lots of memory if you have lots of e-mails with attachments.
To improve memory efficiency, this PR changes CeleryEmailBackend.send_messages to run email_to_dict on one chunk of serialized e-mails at a time.
Benchmarks (on 80 emails with a 5 mb attachment):
Currently
CeleryEmailBackend.send_messages
works like this:email_to_dict
and stored in a listSerializing all the e-mails at once can use lots of memory if you have lots of e-mails with attachments.
To improve memory efficiency, this PR changes
CeleryEmailBackend.send_messages
to runemail_to_dict
on one chunk of serialized e-mails at a time.Benchmarks (on 80 emails with a 5 mb attachment):