diff --git a/date_api/date_api.module b/date_api/date_api.module
index d85a8a5..bdc43c7 100644
--- a/date_api/date_api.module
+++ b/date_api/date_api.module
@@ -2100,6 +2100,25 @@ function date_part_format($part, $format) {
  *   The format string with all other elements removed.
  */
 function date_limit_format($format, $granularity) {
+  // Use the advanced drupal_static() pattern, since this can be called very
+  // often.
+  static $drupal_static_fast;
+  if (!isset($drupal_static_fast)) {
+    $drupal_static_fast['formats'] = &drupal_static(__FUNCTION__);
+  }
+  $formats = &$drupal_static_fast['formats'];
+
+  $granularity_cid = implode(',', $granularity);
+  if (!isset($formats[$format][$granularity_cid])) {
+    $formats[$format][$granularity_cid] = _date_limit_format($format, $granularity);
+  }
+  return $formats[$format][$granularity_cid];
+}
+
+/**
+ * This is the where the real work of date_limit_format() is done.
+ */
+function _date_limit_format($format, $granularity) {
   // If punctuation has been escaped, remove the escaping. Done using strtr()
   // because it is easier than getting the escape character extracted using
   // preg_replace().
