Some questions about disabling GC:

* Memory consuming action - will it kill server?

* Very small (not memory consuming) action - won't GC.start slow it
down significantly? (it's called every time)

* Lets assume that one of your libraries used by the action is calling
GC.start explicitly - the library "knows" it consumes a lot of memory
and tries to free it in the right time - what will happen?


These are just some random questions about "bad" scenarios.


On Nov 12, 6:02 pm, "Enrico Thierbach"
<[EMAIL PROTECTED]> wrote:
> Hi everyone,
>
> I found and tried two optimization hacks; however, I don't feel too
> comfortable with them. Therefore I would appreciate your opinion:
>
> - Caching proc objects, i.e.
>
>   class Symbol
>     def to_proc
>       @to_proc ||= Proc.new { |*args| args.shift.__send__(self, *args) }
>     end
>   end
>
> - and disabling the GC during an action:
>
>   around_filter do |controller, action|
>     GC.disable
>     begin
>       action.call
>     ensure
>       GC.enable
>       GC.start
>     end
>   end
>
> On some of our machines and with some requests they boost performance
> by as much as 50%. however, as I don't know if I shuld feel ssave with
> them I would like to hear your opinions.
>
> BTW: A longer version of this text, with some explanation, is 
> here:http://1rad.wordpress.com/2008/11/10/0x0a-some-optimization-hacks/
>
> /eno
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to