diff --git a/modules/gnode/gnode.module b/modules/gnode/gnode.module
index 5759c0e..f25a958 100644
--- a/modules/gnode/gnode.module
+++ b/modules/gnode/gnode.module
@@ -122,6 +122,11 @@ function gnode_node_grants(AccountInterface $account, $op) {
     return ['gnode_bypass' => [GNODE_MASTER_GRANT_ID]];
   }
 
+  $account_graphs = &drupal_static(__FUNCTION__);
+  if (isset($account_graphs[$account->id() . ':' . $op])) {
+    return $account_graphs[$account->id() . ':' . $op];
+  }
+
   // Gather the machine names of all node types.
   $entity_type_manager = \Drupal::entityTypeManager();
   $node_type_ids = $entity_type_manager
@@ -238,7 +243,9 @@ function gnode_node_grants(AccountInterface $account, $op) {
   }
 
   // Recursively merge the member grants with the anonymous/outsider grants.
-  return array_merge_recursive($grants_m, $grants_ao);
+  $account_graphs[$account->id() . ':' . $op] = array_merge_recursive($grants_m, $grants_ao);
+
+  return $account_graphs[$account->id() . ':' . $op];
 }
 
 /**
