diff options
author | Yehuda Katz <wycats@gmail.com> | 2009-08-09 03:28:46 -0300 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-08-09 04:12:09 -0300 |
commit | e58b2769cf2c4df348d4ac31a8c5497cbd545564 (patch) | |
tree | 6ec76a37ffb1b1da11b11f7f6563cf2d24cbe43f /activesupport/lib/active_support/core_ext/load_error.rb | |
parent | 10eaba8f412d3acbdb6a57e1cd457e074c127953 (diff) | |
download | rails-e58b2769cf2c4df348d4ac31a8c5497cbd545564.tar.gz rails-e58b2769cf2c4df348d4ac31a8c5497cbd545564.tar.bz2 rails-e58b2769cf2c4df348d4ac31a8c5497cbd545564.zip |
Experimental: Improve performance of ActionView by preventing method cache flushing due to runtime Kernel#extend:
* The helper module adds a new _helper_serial property onto AbstractController subclasses
* When #helper is used to add helpers to a class, the serial number is updated
* An ActionView subclass is created and cached based on this serial number.
* That subclass includes the helper module from the controller
* Subsequent requests using the same controller with the same serial will result in
reusing that subclass, rather than being forced to take an action (like include
or extend) that will result in a global method cache flush on MRI and a flush
of the entire AV class' cache on JRuby.
* For now, this optimization is not applied to the RJS helpers, which results in
a global method cache flush in MRI and a flush of the JavaScriptGenerator class in
JRuby only when using RJS.
* Since the effects are limited to using RJS, and would only affect JavaScriptGenerator
in JRuby (as opposed to the entire view object), it seems worthwhile to apply this
now.
* This resulted in a significant performance improvement. I will have benchmarks
in the next day or two that show the performance impact of the last several
commits.
* There is a small chance this could break existing code (although I'm not sure how).
If that happens, please report it immediately.
Diffstat (limited to 'activesupport/lib/active_support/core_ext/load_error.rb')
0 files changed, 0 insertions, 0 deletions