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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---