This project is archived and is in readonly mode.
STI slow, result of ActiveRecord#find_sti_class should be cached!
-
thieso (at gmail)
- Tag changed from active_record, performance, sti to active_record, patch, performance, sti
-
Jeremy Kemper
- Milestone cleared.
- State changed from new to open
- Assigned user set to Jeremy Kemper
- Importance changed from to Low
Good idea. However, Thieso's patch will break in development mode since the memoized classes will be reloaded. We can use
ActiveSupport::Dependencies.constantize(name)to memoize the lookup within the duration of a request. -
Jeremy Kemper
- State changed from open to resolved
-
Andrew White
We can speed this up by another 30% by optimizing the case where store_full_sti_class is true. This has been the default for some time now so should be the case for the vast majority of apps.
-
Repository
(from [ad063263bcaffb97f3e8d625d24c19d51b95b839]) Optimize find_sti_class when store_full_sti_class is true
[#5403 STI slow, result of ActiveRecord#find_sti_class should be cached! ]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/ad063263bcaffb97f3e8d625d24c19... -
Repository
(from [0b73f2af0e08c21ff75199505804993160117452]) Optimize find_sti_class when store_full_sti_class is true
[#5403 STI slow, result of ActiveRecord#find_sti_class should be cached! ]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/0b73f2af0e08c21ff7519950580499...
