Skip to content

improve performance of mailwatch_milter_relay.php#1266

Merged
endelwar merged 2 commits intomailwatch:1.2from
dneuhaeuser:milterrelay
Jul 24, 2023
Merged

improve performance of mailwatch_milter_relay.php#1266
endelwar merged 2 commits intomailwatch:1.2from
dneuhaeuser:milterrelay

Conversation

@dneuhaeuser
Copy link
Copy Markdown
Contributor

the code part which executes the SQL commands does not need to run after each line from the logfile is processed.
instead it is sufficient to run SQL statements once after logfile is analyzed and relevant data was read into $idqueue array.
so I moved this part into a separate function.
this is a quite simple but very performance-effective change.

$i needs to be decreased in for-loops after array_splice, otherwise we are skipping the next array element.

removed useless global

improved debug logging
@ghost
Copy link
Copy Markdown

ghost commented Nov 2, 2022

Very nice! I'll give this a test drive as well

@ghost
Copy link
Copy Markdown

ghost commented Mar 12, 2023

This is good.

@dneuhaeuser
Copy link
Copy Markdown
Contributor Author

can we merge this one or do you want any further changes?

@endelwar endelwar merged commit c467de9 into mailwatch:1.2 Jul 24, 2023
@endelwar
Copy link
Copy Markdown
Member

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants