rails/rails — pull request #7457 by jrafanie (2012-08-27 17:03:12+00:00)
Title: Added logging of model instantiation.

The current logging of sql queries only logs the actual query time which is great for finding slow queries. Unfortunately, it does not log the record instantiation time, which can be slow due to model bugs or inappropriate usage of callbacks.

We use this internally to detect when our models are slow due to callbacks, serialization, or any other potentially slow ActiveRecord hooks.