Just to be clear, what specific performance tests are you having a problem 
with? 

Refactoring for better readability/maintainability every time your tests are 
green is a good practice. 

Trying to make micro-optimizations in memory profile, sql queries, caching, etc 
without a specific failing performance test and profiling results showing which 
query or page load is causing the problem just burns time and obfuscates your 
code. Apart from anything else, the things that make your app slow are probably 
not those that you expect it to be.

The only thing I would say is that if you have a transient object that doesn't 
require persistence (I have a location object in a new app - I don't store 
locations - I just use them to handle geocoding and to return a list of places 
from a third party service) from what I understand (I'm still new to best Rails 
practices), it's quite reasonable to put that in the lib directory. I wouldn't 
wrap an entire AR lifecycle around a Class that I did not plan to persist the 
instances of. But that's not to improve performance (although it might in some 
way) but because it seems more semantically accurate - it better expresses my 
intent.

Best Wishes,
Peter

On Jan 12, 2011, at 4:14 PM, Me wrote:

> not sure what else to say.  If you have a db table with 2 lines that are 
> never going to change.  You refactor that into the other model that 
> references it and remove the original AR model.  I was wondering, when you 
> remove the table if you were to keep the original model but refactor the stuf 
> into that mode instead of the referring model does it consume the same 
> memory, BW, whatever, as opposed to the AR version of the model.
> 
> -- 
> 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.

-- 
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.

Reply via email to