Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lazy mode for daemon #60

Closed
1 task
alexkiro opened this issue Jun 21, 2016 · 0 comments
Closed
1 task

Add lazy mode for daemon #60

alexkiro opened this issue Jun 21, 2016 · 0 comments

Comments

@alexkiro
Copy link
Contributor

alexkiro commented Jun 21, 2016

We should add the ability to activate a lazy mode for the daemon to optimize memory. There are several places where this can bring a memory optimization:

  • Message header parsing, removing the memoize decorator
  • Message part extraction
  • Regex rules compilation, instead of pre-compiling rules these should be compiled on the spot. A compiled regular expression will take more memory than just a string
  • Meta rules, discard storing the location and preparing the rule in the init and move it post-parsing and only store the resulting lambda match method. ''This should actually be done by default'' as there is no immediate benefit of storing this extra data.

The "lazy" mode should be turned on by default. And this should be configurable via configuration file or command line (whichever is easier).
To deactivate lazy mode run match.py or daemon with option ("-dl", "--deactivate-lazy").


Acceptance criteria:

  • Everything should work the same as before
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants