silverstripe/sapphire — pull request #936 by halkyon (2012-11-07 04:27:52+00:00)
Title: Fixing performance of DataObject::custom_database_fields()

On sites with lots of modules, and pages with plenty of database
queries, DataObject::custom_database_fields() can be called
thousands of times, and slow down page render times. This fixes
it so the fields are cached by class in a static variable, and
are cleared when reset() is called on the DataObject.