On 28/06/09 15:47, Luke Kanies wrote: > I have two questions about this: > > 1) Any idea how this affects performance?
Interesting question. So I ran puppetdoc (which incidently uses the parser to parse every manifest) on the Days of Wonder manifests (about 100 manifests, spread in about 50 modules). With this patch, I get on an average of 3 run after a blank run: 6.084s Without the patch: 6.022s So with the patch we're 1.1% slower with the patch. > 2) Is it reasonable to just create an instance of a new class here, or > maybe a struct, rather than passing a hash? The hash is built the > same every time (although obviously with different data), which > implies it makes sense to use a class. Yes, you're right, I'll rework this patch. > It'd be best if we could just return the instance to the parser, > rather than [:token, ...], but we'd probably need to find some way to > make the token evaluate appropriately for the grammar. > That is, it might work to add a 'to_s' method that returns the token > string. Unfortunately I don't think racc will support this, because it explecitily wants an array of a Symbol and token object: http://i.loveruby.net/en/projects/racc/doc/parser.html > The performance thing probably isn't a big deal, but considering the > number of lexing tokens in a given configuration, it's at least worth > looking at. It'd be great if someone with a big configuration can > give this a try. Yes, that'd be great. -- Brice Figureau My Blog: http://www.masterzen.fr/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
