On Jul 18, 2008, at 2:10 AM, Daniel Pittman wrote:
>
> Luke Kanies <[EMAIL PROTECTED]> writes:
>>
>>
>> Any idea of the performance implications of this?
>> Seems like it would be more expensive, but I don't know how much  
>> more.
>>
>> As long as it's not 10x more expensive or anything, I'm not against
>> this basic patch, although I'd like to see tests.
>
> Well, some ad-hoc testing tells me that we are looking at ~ 5µs per
> variable and 5µs per level of nesting on a 2.6GHz CPU, which should
> vanish into the noise floor in most cases, I think.
>
> However, testing is sensible: I can't see any existing tests for
> performance, which I imagine is what you are primarily looking for.

Sorry; I meant unit testing for the scope and templatewrapper.

It's essentially impossible to have performance unit tests; we'll  
eventually have continuous integration with performance data, but in  
the meantime, functional tests are what I mostly care about.

For performance, ad-hoc testing is essentially sufficient.

>
> Are there examples that I have missed or, if not, can you give any
> direction on how best to write them?  I am concerned that my relative
> lack of experience with Ruby will lead to bad design choices there.

The TemplateWrapper class's tests are in spec/unit/parser, but the  
scope tests haven't been translated to spec/ yet.

What I'd expect to see, at a minimum, is updating of the existing  
tests to match this new behaviour.  What I'd *love* to see at the same  
time is a rewrite of the scope tests to be in spec/, but I'd accept  
the patch with test/unit tests for scope.

>
>> I figure we can actually deprecate the current style as part of 0.25
>> (with warnings, for a while).
>
> Not done yet: I don't know the best approach to implementing that  
> within
> Puppet, and would value your advice.

There's a warnonce method defined in util/warnings.rb, which you can  
use to provide the warning.  Ideally, we'd have a 'deprecate' method  
somewhere that we could use to provide a deprecation date, log, etc.   
I haven't gone through the effort to do this, but if you're willing  
to, of course, I'd love to see it.

-- 
I used to get high on life but lately I've built up a resistance.
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com


--~--~---------~--~----~------------~-------~--~----~
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