--- admin_menu.module.orig	2008-06-26 22:08:37.000000000 +0200
+++ admin_menu.module	2008-07-18 04:20:03.218750000 +0200
@@ -142,10 +142,8 @@ function admin_menu_tree_output($tree) {
 
   foreach ($tree as $data) {
     $extra_class = isset($data['link']['localized_options']['extra class']) ? $data['link']['localized_options']['extra class'] : NULL;
-    // Omit alias lookups.
-    $data['link']['localized_options']['alias'] = TRUE;
+    $link = admin_menu_item_link($data['link']);
 
-    $link = theme('menu_item_link', $data['link']);
     if ($data['below']) {
       $output .= theme('admin_menu_item', $link, $data['link']['has_children'], admin_menu_tree_output($data['below']), $data['link']['in_active_trail'], $extra_class);
     }
@@ -157,6 +155,18 @@ function admin_menu_tree_output($tree) {
 }
 
 /**
+ * High-performance implementation of theme_menu_item_link().
+ *
+ * This saves us a theme() call and does only the absolute minimum to get
+ * the admin menu links rendered.
+ */
+function admin_menu_item_link($link) {
+  // Omit alias lookups.
+  $link['localized_options']['alias'] = TRUE;
+  return '<a href="'. check_url(url($link['href'], $link['localized_options'])) .'">'. ($link['localized_options']['html'] ? $link['title'] : check_plain($link['title'])) .'</a>';
+}
+
+/**
  * Generate the HTML output for a single menu item and submenu.
  *
  * @param string $link
@@ -184,7 +194,6 @@ function theme_admin_menu_item($link, $h
   return '<li'. (!empty($class) ? ' class="'. $class .'"' : '') .'>'. $link . $menu .'</li>';
 }
 
-
 /**
  * Implementation of hook_form_[form_id]_alter().
  *
