Issue #2917 has been updated by Ward Vandewege.

Ruby does check if the library files have changed, which take 10+ stat
system calls because it looks for it in the path.  Here is a ruby program
that can test that:

<pre>
 #!/usr/bin/ruby

 require 'digest/md5'

 (0..10000).each do
   File.stat(__FILE__)
 end
</pre>

The time to run goes from 0.06s to 0.60s if you move the require inside
the loop. Running strace shows the stats happening.

----------------------------------------
Bug #2917: performance improvement for puppet/util/checksums.rb
http://projects.reductivelabs.com/issues/2917

Author: Ward Vandewege
Status: Rejected
Priority: Normal
Assigned to: Markus Roberts
Category: fileserving
Target version: 0.25.2
Affected version: 0.25.1
Keywords: 
Branch: 


The attached patch moves the require digest/md5 and digest/sha1 lines out from 
the functions to the top of the file so they get executed only once; when a 
checksum has to be done on a lot of files that speeds up execution a bit.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--

You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" 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-bugs?hl=en.


Reply via email to