The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Slow require of ruport unconvered

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Gregory Brown

Posts: 172
Nickname: greg7224
Registered: Nov, 2005

Gregory Brown is the author of Ruby Reports (ruport)
Slow require of ruport unconvered Posted: Jun 14, 2006 1:01 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Gregory Brown.
Original Post: Slow require of ruport unconvered
Feed Title: Ruby Reports Blog
Feed URL: http://www.cwinters.com/blog/index.rss
Feed Description: News and Updates regarding the Ruby Reports library and toolset.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Gregory Brown
Latest Posts From Ruby Reports Blog

Advertisement

Well, some of you may have noticed this:

[greg@bulbasaur ruport]$ time ruby -Ilib -e 'require "ruport"'

real    0m0.573s
user    0m0.524s
sys     0m0.040s
[greg@bulbasaur ruport]$ time ruby -rubygems -e 'require "ruport"'

real    0m2.807s
user    0m2.320s
sys     0m0.248s

Gems was auto-requiring all the deps even though we said 'no thank you sir' in the gemspec.

Well to be fair, fastercsv would have been loaded anyway in Ruport 0.4.5, because it was required globally (with a rescue)

Still, that's not a big time hit. See on 0.4.5:

[greg@bulbasaur rel_0_4_5]$ time ruby -Ilib -e 'require "ruport"'

real    0m0.790s
user    0m0.696s
sys     0m0.084s

Luckily, RubyGems 0.9.0 will fix this.

If you want to see for yourself, go ahead and do:

gem update --system --source http://onestepback.org/betagems
Mmh... nice fast loads.
[greg@bulbasaur ruport]$ time ruby -rubygems -e 'require "ruport"'

real    0m0.779s
user    0m0.696s
sys     0m0.068s

For the nerdy, I think this patch would solve the problem in 0.8.11, but definitely don't use it! ;)


--- rubygems.rb 2006-06-13 22:48:48.000000000 -0400
+++ rubygems-fix.rb     2006-06-13 22:49:22.000000000 -0400
@@ -164,7 +164,7 @@

      # Load dependent gems first
      spec.dependencies.each do |dep_gem|
-       activate(dep_gem, autorequire)
+       activate(dep_gem, spec.autorequire)
      end

      # add bin dir to require_path

Read: Slow require of ruport unconvered

Topic: Rails satire Previous Topic   Next Topic Topic: Documentación de Spring, aplicaciones de escritorio y más Java

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use