Paul Xue
Paul Xue
Yeah the Rails app I'm working on is pretty ginormous. Here's the benchmarks: ``` [1] pry(main)> ObjectSpace.each_object(Module) {} => 26605 [2] pry(main)> t=Time.now; 10.times {ObjectSpace.each_object(Module) {|m| m }}; Time.now-t =>...
I think your hunch is right, here: ``` [1] pry(main)> ObjectSpace.each_object(Module).select {|m| RailsDevelopmentBoost::DependenciesPatch::Util.anonymous_const?(m)}.size => 19224 ``` So this is interesting. I did read about anonymous module/classes and their side effects....
Is keeping a persistent set/hash of anon class to skip the `_mod_name` look up a good solution? ``` require 'set' anon = Set.new([]) 2.times do t = Time.now ObjectSpace.each_object(Module) do...
> You could alleviate the problem by giving your anonymous modules names, not sure have feasible that is given your app's constraints: This is what I was planning. In config/application.rb...
@thedarkone Nice! we should back contribute to the discussion. we have some nice real world benches here of the problem.
What's the status of this? It's very common usage.
The intermediate fix is to just clone the entire AwsS3 provider and implement it myself instead of parsing eTag / location from the header, it's parsed from the response body...