Actionview_precompiler

screenshot of Actionview_precompiler

Precompiles ActionView templates at app boot for Rails 6+

Overview

The ActionviewPrecompiler gem provides eager loading of Action View templates. It aims to improve cold render times and allow more memory to be shared via Copy on Write (CoW) on forking web servers. The gem is an optimization that can be tested out to eventually be included in Rails. It detects rendered views in an application and shows promising results in improving view compilation times. However, there is a potential downside of wasting memory if render calls are mispredicted.

Features

  • Eager loading of Action View templates
  • Improved cold render times
  • Memory sharing via CoW on forking web servers
  • Optimization to be eventually included in Rails
  • Ability to test and validate detection of rendered views in an application
  • Promising results in improving view compilation times

Summary

The ActionviewPrecompiler gem is an optimization for improving the cold render times of Action View templates in Rails applications. It allows for eager loading of templates and aims to improve memory sharing on forking web servers. Although it is not necessary for most applications, it provides a way to test and validate the optimization. By detecting rendered views, the gem shows promising results in improving view compilation times. However, there is a potential downside of wasting memory if render calls are mispredicted.