3 ms·
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
by resca79 11y ago
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
- aantix 11y agoMy 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.
- blizkreeg 11y agoSame experience here. View renders have been the dog, the db queries with the right indexes and done smartly, have been fast.
- Rafert 11y agoJust 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 https://github.com/k0kubun/hamlit
- anko 11y agoOut 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.