Skip to content
This repository has been archived by the owner on Jul 24, 2018. It is now read-only.

Cache the results of rules for each message. #10

Merged
merged 2 commits into from Aug 14, 2014

Conversation

ralphbean
Copy link
Contributor

..then dispose of that cache once we're finished with each message.

A typical rule is "is this a koji message?" Say we have 500 users, for
every message that comes in we're going to call that function 500 * 2 times
(once for email and once for IRC). This builds a little cache at the
beginning of processing each message where we can store that result and
re-use it for each user/context. We then throw it away and start over when
we're done processing that message.

Also:

Instantiate rule code_paths at load-time instead of consume-time.

..then dispose of that cache once we're finished with each message.

A typical rule is "is this a koji message?"  Say we have 500 users, for every
message that comes in we're going to call that function 500 * 2 times (once for
email and once for IRC).  This builds a little cache at the beginning of
processing each message where we can store that result and re-use it for each
user/context.  We then throw it away and start over when we're done processing
that message.
@pypingou
Copy link
Member

Looks sane from what I can see

ralphbean added a commit that referenced this pull request Aug 14, 2014
Cache the results of rules for each message.
@ralphbean ralphbean merged commit 595312a into develop Aug 14, 2014
@ralphbean ralphbean deleted the feature/optimizations branch August 14, 2014 17:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants