Improve mail transmission perf, invoice creation#32
Conversation
|
fyi @Merlijnv |
7d561ea to
2ab87bb
Compare
jallmenroeder
left a comment
There was a problem hiding this comment.
Looks good to me, but I did not test it myself. Maybe there's further improvement in submitting a list of all mails to the send_messages() function, instead of one message at a time. But I'm not sure if it's worth it.
|
Thanks!
I don't think that should make a real perf difference because and the heavy stuff in that function (establish connection) is already done/skipped with each call I agree that a more extensive refactoring could have been nice though. |
Fixes issue #31 Previously, pybarsys opened a new connection for each mail. With this change, it (for the most part) opens one connection and keeps that open for all mails. This seems to improve perf by roughly 10x in some simple tests, making it less frustrating to generate a lot of invoices. If there is an error during mail tx, new invoices now are automatically deleted to not make it seem like they were delivered to the user. There was a small validation bug which made it impossible to create a new user for which someone else has to pay in one go (how was this never a bug report?!). Updated some dependency to make it compatible with recent Python versions. Actually, a lot more updates are needed...
2ab87bb to
21ace07
Compare
Previously, pybarsys opened a new connection for each mail. With this change, it (for the most part) opens one connection and keeps that open for all mails.
This seems to improve perf by roughly 10x in some
simple tests, making it less frustrating to generate a lot of invoices.
If there is an error during mail tx, new invoices now are automatically deleted to not make it seem like they were delivered to the user.
There was a small validation bug which made it impossible to create a new user for which someone else has to pay in one go (how was this never a bug report?!).
Updated some dependency to make it compatible with recent Python versions. Actually, a lot more updates are needed...