Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you have problem mem space you can use to Model cache instead of the view cache. In many use cases the view render is very fast , except if you have to many logic inside it . You can save memory without save html tags , considering that many cached views have the some models/record in input


My experience has been the exact opposite (even with simple views); the view layer always incurs the most CPU time. With the proper indexes and eager loading, data retrieval is incredibly quick.


Just curious, what are you using: ERB, Haml, Slim? According to this gem Haml could be a lot faster, but I haven't had the chance yet to check it out: https://github.com/k0kubun/hamlit


Out of interest, what database do you use? And how many joins do you normally do per view?

We use postgres and once you get to around 1m records, even COUNT is slow as it does a full table scan, even with indexes.


Same experience here. View renders have been the dog, the db queries with the right indexes and done smartly, have been fast.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: