Bug 7496 - Speed up rule parsing on startup
Summary: Speed up rule parsing on startup
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Libraries (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: All All
: P2 normal
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-01 22:26 UTC by Todd Rinaldo
Modified: 2018-02-06 05:11 UTC (History)
2 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status
Proposed fix. patch None Todd Rinaldo [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Todd Rinaldo 2017-11-01 22:26:43 UTC

    
Comment 1 Todd Rinaldo 2017-11-01 22:27:34 UTC
Created attachment 5475 [details]
Proposed fix.

This commit does several tricks to speed up startup code including

- use index to avoid unnecessary regexes
- use tr when instead of a match regex.
- elsif instead of sequential if checks for a string match
- one time regex compiling (don't believe the rumors that
  the "o" modifier doesn't do anything on unthreaded perl)
Comment 2 Kevin A. McGrail 2018-02-06 05:11:31 UTC
Thanks.

3.4:
Committed revision 1823274.
Trunk:
Committed revision 1823275.