From 7c36f5d834b1817883e1716550e07c1fbce77919 Mon Sep 17 00:00:00 2001 From: Edward Faulkner Date: Thu, 11 Aug 2011 22:51:45 -0400 Subject: [PATCH] Make RecordAttributes cacheable RecordAttributes are not cacheable, despite having some code that looks like it was originally intended to make them so. This has a noticeable performance impact, especially for Dates, which are relatively expensive to parse. --- lib/attributes/record_attribute.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/attributes/record_attribute.js b/lib/attributes/record_attribute.js index 21d88a9..9d7b18a 100644 --- a/lib/attributes/record_attribute.js +++ b/lib/attributes/record_attribute.js @@ -312,9 +312,6 @@ SC.RecordAttribute = SC.Object.extend( /** @private - Make this look like a property so that `get()` will call it. */ isProperty: YES, - /** @private - Make this look cacheable */ - isCacheable: YES, - /** @private - needed for KVO `property()` support */ dependentKeys: [], @@ -336,7 +333,7 @@ SC.RecordAttribute = SC.Object.extend( var attr = this; var ret = SC.computed(function(key, value) { return attr.call(this, key, value); - }); + }).cacheable(); ret.attr = attr; return ret ; }