On Mar 18, 2010, at 4:06 AM, Brice Figureau wrote:

On Wed, 2010-03-17 at 16:38 -0700, Luke Kanies wrote:
You've got a spare 'put's in there, but otherwise, +1.

Do you think this might be just the wrong way of doing this matching
overall? My instincts around graphs seem to be particularly horrible,
so there's probably a much better way to do this.

There's something I'm not sure I completely understood:
In this case of interest, all the "change" events are coming from the
generated sub file resources.
If I correctly read the code, we are collecting events from all those
generated resources.

Then we take the source (ie the root file of the recursive file) and for
each event scan all the edges out of this resources (most if not all
will be the auto-required generated sub file resources) to find those
that match (this cross join between events and out edges is what is
killing our performance).

As I understand it, we're trying to flow the events back to where they
were created, am I correct?
If yes, this should be completely un-needed, and we should prevent the
events to flow along those edges.

You are right - we could probably do a quick test before we collect events, to determine if there are any subscriptions. If not, we can just ignore the events entirely and save a bunch of time.

There's probably also some kind of 'break' we can do - functionally, one event is equivalent to 100 events, in terms of the behaviour of the system, so we could just keep a boolean and pass it around, or maybe just count the events or something.

I think there are a couple of different optimizations available.

--
The one thing more difficult than following a regimen is not imposing it
on others. -- Marcel Proust
---------------------------------------------------------------------
Luke Kanies  -|-   http://reductivelabs.com   -|-   +1(615)594-8199

--
You received this message because you are subscribed to the Google Groups "Puppet 
Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to