On 03/03/10 19:22, Markus Roberts wrote: > On Wed, Mar 3, 2010 at 12:22 AM, Brice Figureau < > [email protected]> wrote: > >> On Tue, 2010-03-02 at 14:08 -0800, Markus Roberts wrote: >>> Just glancing at the code between meetings, it looks as if it might be >>> cleaner to just push all the Puppet[:casesensitive] --> sensitive --> >>> blah.downcase logic down into evaluate_match and not trying to finesse >>> it at the calling level. >>> >>> Thoughts? >> >> Doing that would produce cleaner code, but would force us to constantly >> call downcase for the comparing value each time we want to compare it >> with a case value. >> This would hurt my feelings (I like efficient things) :-) > > > I suspect this is a false economy; downcase is in c and should be blindingly > fast compared to things at the ruby level; the overhead of passing it (and > the settings value) around could easily exceed the savings of only doing the > downcase once. A quick test shows downcasing a line of text takes on the > order of 10^-6 seconds, about the same as building a single pair in a hash.
You're certainly right. My background (ie C/C++ coder) makes me reluctant in front of such patterns. I'll implement the proposed change then. -- 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.
