diff --git a/frontends/php/app/controllers/CControllerWidgetNavTreeView.php b/frontends/php/app/controllers/CControllerWidgetNavTreeView.php
index 35ab37b..716ce01 100644
--- a/frontends/php/app/controllers/CControllerWidgetNavTreeView.php
+++ b/frontends/php/app/controllers/CControllerWidgetNavTreeView.php
@@ -43,11 +43,11 @@ class CControllerWidgetNavTreeView extends CControllerWidget {
 		$sysmapids = array_keys(array_flip(zbx_objectValues($navtree_items, 'mapid')));
 
 		$sysmaps = API::Map()->get([
-			'sysmapids' => $sysmapids,
-			'preservekeys' => true,
 			'output' => ['sysmapid', 'severity_min'],
 			'selectLinks' => ['linktriggers', 'permission'],
-			'selectSelements' => ['elements', 'elementtype', 'permission']
+			'selectSelements' => ['elements', 'elementtype', 'permission'],
+			'sysmapids' => $sysmapids,
+			'preservekeys' => true
 		]);
 
 		if ($sysmaps) {
@@ -75,11 +75,11 @@ class CControllerWidgetNavTreeView extends CControllerWidget {
 			$sysmaps_resolved = array_keys($sysmaps);
 			while ($diff = array_diff($submaps_found, $sysmaps_resolved)) {
 				$submaps = API::Map()->get([
-					'sysmapids' => $diff,
-					'preservekeys' => true,
 					'output' => ['sysmapid', 'severity_min'],
 					'selectLinks' => ['linktriggers', 'permission'],
-					'selectSelements' => ['elements', 'elementtype', 'permission']
+					'selectSelements' => ['elements', 'elementtype', 'permission'],
+					'sysmapids' => $diff,
+					'preservekeys' => true
 				]);
 
 				$sysmaps_resolved = array_merge($sysmaps_resolved, $diff);
@@ -116,11 +116,13 @@ class CControllerWidgetNavTreeView extends CControllerWidget {
 								$host_groups[$element['groupid']] = true;
 							}
 							break;
+
 						case SYSMAP_ELEMENT_TYPE_TRIGGER:
 							foreach (zbx_objectValues($selement['elements'], 'triggerid') as $triggerid) {
 								$problems_per_trigger[$triggerid] = $this->problems_per_severity_tpl;
 							}
 							break;
+
 						case SYSMAP_ELEMENT_TYPE_HOST:
 							if (($element = reset($selement['elements'])) !== false) {
 								$hosts[$element['hostid']] = true;
@@ -155,6 +157,7 @@ class CControllerWidgetNavTreeView extends CControllerWidget {
 
 			// Get triggers related to hosts.
 			if ($hosts) {
+				// ~1.7s!
 				$triggers = API::Trigger()->get([
 					'output' => ['triggerid'],
 					'selectHosts' => ['hostid'],
@@ -178,9 +181,9 @@ class CControllerWidgetNavTreeView extends CControllerWidget {
 			if ($problems_per_trigger) {
 				$triggers = API::Trigger()->get([
 					'output' => [],
-					'triggerids' => array_keys($problems_per_trigger),
-					'skipDependent' => true,
 					'selectGroups' => ['groupid'],
+					'skipDependent' => true,
+					'triggerids' => array_keys($problems_per_trigger),
 					'preservekeys' => true,
 					'monitored' => true
 				]);
@@ -225,35 +228,32 @@ class CControllerWidgetNavTreeView extends CControllerWidget {
 									$triggers_per_host_groups
 								);
 
-								if (is_array($problems)) {
-									$response[$itemid] = array_map(function () {
-										return array_sum(func_get_args());
-									}, $response[$itemid], $problems);
+								if ($problems !== null) {
+									$response[$itemid] = CArrayHelper::sumArrayValues($response[$itemid], $problems);
 								}
 							}
 						}
 
 						// Count problems occurred in triggers which are related to links.
 						foreach ($map['links'] as $link) {
-							foreach ($link['linktriggers'] as $lt) {
-								if (!array_key_exists($lt['triggerid'], $problems_counted)) {
-									$problems_to_add = $problems_per_trigger[$lt['triggerid']];
-									$problems_counted[$lt['triggerid']] = true;
-
-									// Remove problems which are less important than map's min-severity.
-									if ($map['severity_min'] > 0) {
-										foreach ($problems_to_add as $sev => $probl) {
-											if ($map['severity_min'] > $sev) {
-												$problems_to_add[$sev] = 0;
-											}
+							$uncounted_triggers = CArrayHelper::unsetEqualKeys(
+								array_flip(zbx_objectValues($link['linktriggers'], 'triggerid')),
+								$problems_counted);
+
+							foreach ($uncounted_triggers as $triggerid => $_) {
+								$problems_to_add = $problems_per_trigger[$triggerid];
+								$problems_counted[$lt['triggerid']] = true;
+
+								// Remove problems which are less important than map's min-severity.
+								if ($map['severity_min'] > 0) {
+									foreach ($problems_to_add as $sev => $probl) {
+										if ($map['severity_min'] > $sev) {
+											$problems_to_add[$sev] = 0;
 										}
 									}
-
-									// Sum problems.
-									$response[$itemid] = array_map(function() {
-										return array_sum(func_get_args());
-									}, $problems_to_add, $response[$itemid]);
 								}
+
+								$response[$itemid] = CArrayHelper::sumArrayValues($response[$itemid], $problems_to_add);
 							}
 						}
 					}
@@ -283,46 +283,45 @@ class CControllerWidgetNavTreeView extends CControllerWidget {
 
 				if (($element = reset($selement['elements'])) !== false) {
 					if (array_key_exists($element['groupid'], $triggers_per_host_groups)) {
-						foreach ($triggers_per_host_groups[$element['groupid']] as $triggerid => $val) {
-							if (!array_key_exists($triggerid, $problems_counted)) {
-								$problems_counted[$triggerid] = true;
-								$problems = array_map(function() {
-									return array_sum(func_get_args());
-								}, $problems_per_trigger[$triggerid], $problems);
-							}
+						$uncounted_triggers = CArrayHelper::unsetEqualKeys(
+							$triggers_per_host_groups[$element['groupid']], $problems_counted
+						);
+
+						foreach ($uncounted_triggers as $triggerid => $_) {
+							$problems_counted[$triggerid] = true;
+							$problems = CArrayHelper::sumArrayValues($problems, $problems_per_trigger[$triggerid]);
 						}
 					}
 				}
 				break;
+
 			case SYSMAP_ELEMENT_TYPE_TRIGGER:
 				$problems = $this->problems_per_severity_tpl;
+				$uncounted_triggers = CArrayHelper::unsetEqualKeys(
+					array_flip(zbx_objectValues($selement['elements'], 'triggerid')), $problems_counted);
 
-				foreach (zbx_objectValues($selement['elements'], 'triggerid') as $triggerid) {
-					if (!array_key_exists($triggerid, $problems_counted)) {
-						$problems_counted[$triggerid] = true;
-
-						$problems = array_map(function() {
-							return array_sum(func_get_args());
-						}, $problems_per_trigger[$triggerid], $problems);
-					}
+				foreach ($uncounted_triggers as $triggerid => $_) {
+					$problems_counted[$triggerid] = true;
+					$problems = CArrayHelper::sumArrayValues($problems, $problems_per_trigger[$triggerid]);
 				}
 				break;
+
 			case SYSMAP_ELEMENT_TYPE_HOST:
 				$problems = $this->problems_per_severity_tpl;
 
 				if (($element = reset($selement['elements'])) !== false) {
 					if (array_key_exists($element['hostid'], $triggers_per_hosts)) {
-						foreach ($triggers_per_hosts[$element['hostid']] as $triggerid => $val) {
-							if (!array_key_exists($triggerid, $problems_counted)) {
-								$problems_counted[$triggerid] = true;
-								$problems = array_map(function() {
-									return array_sum(func_get_args());
-								}, $problems_per_trigger[$triggerid], $problems);
-							}
+						$uncounted_triggers = CArrayHelper::unsetEqualKeys(
+							$triggers_per_hosts[$element['hostid']], $problems_counted);
+
+						foreach ($uncounted_triggers as $triggerid => $_) {
+							$problems_counted[$triggerid] = true;
+							$problems = CArrayHelper::sumArrayValues($problems, $problems_per_trigger[$triggerid]);
 						}
 					}
 				}
 				break;
+
 			case SYSMAP_ELEMENT_TYPE_MAP:
 				$problems = $this->problems_per_severity_tpl;
 
@@ -355,10 +354,8 @@ class CControllerWidgetNavTreeView extends CControllerWidget {
 										$problems_counted, $triggers_per_hosts, $triggers_per_host_groups
 									);
 
-									if (is_array($problems_in_submap)) {
-										$problems = array_map(function () {
-											return array_sum(func_get_args());
-										}, $problems, $problems_in_submap);
+									if ($problems_in_submap !== null) {
+										$problems = CArrayHelper::sumArrayValues($problems, $problems_in_submap);
 									}
 								}
 							}
@@ -368,16 +365,14 @@ class CControllerWidgetNavTreeView extends CControllerWidget {
 						if (array_key_exists($sysmapid, $sysmaps)) {
 							foreach ($sysmaps[$sysmapid]['links'] as $link) {
 								if ($link['permission'] >= PERM_READ) {
-									foreach ($link['linktriggers'] as $lt) {
-										if (!array_key_exists($lt['triggerid'], $problems_counted)) {
-											$problems_counted[$lt['triggerid']] = true;
-											$add_problems = $problems_per_trigger[$lt['triggerid']];
-
-											// Sum problems.
-											$problems = array_map(function() {
-												return array_sum(func_get_args());
-											}, $add_problems, $problems);
-										}
+									$uncounted_triggers = CArrayHelper::unsetEqualKeys(
+										array_flip(zbx_objectValues($link['linktriggers'], 'triggerid')),
+										$problems_counted
+									);
+
+									foreach ($uncounted_triggers as $triggerid => $lt) {
+										$problems_counted[$triggerid] = true;
+										$problems = CArrayHelper::sumArrayValues($problems, $problems_per_trigger[$triggerid]);
 									}
 								}
 							}
@@ -388,7 +383,7 @@ class CControllerWidgetNavTreeView extends CControllerWidget {
 		}
 
 		// Remove problems which are less important than $severity_min.
-		if (is_array($problems) && $severity_min > 0) {
+		if ($problems !== null && $severity_min > 0) {
 			foreach ($problems as $sev => $probl) {
 				if ($severity_min > $sev) {
 					$problems[$sev] = 0;
diff --git a/frontends/php/include/classes/helpers/CArrayHelper.php b/frontends/php/include/classes/helpers/CArrayHelper.php
index a88b0a2..86a0045 100644
--- a/frontends/php/include/classes/helpers/CArrayHelper.php
+++ b/frontends/php/include/classes/helpers/CArrayHelper.php
@@ -214,6 +214,25 @@ class CArrayHelper {
 		return $a1;
 	}
 
+	public static function unsetEqualKeys(array $a1, array $a2) {
+		foreach ($a1 as $key => $value) {
+			if (isset($a2[$key])) {
+				unset($a1[$key]);
+			}
+		}
+
+		return $a1;
+	}
+
+	public static function sumArrayValues(array $a1, array $a2) {
+		foreach ($a1 as $key => &$value) {
+			$value += $a2[$key];
+		}
+		unset($value);
+
+		return $a1;
+	}
+
 	/**
 	 * Checks if array $arrays contains arrays with duplicate values under the $uniqueField key. If a duplicate exists,
 	 * returns the first duplicate, otherwise returns null.
