From eb2de6ba5cf657a251b29f77d68c2e6f7adb29f2 Mon Sep 17 00:00:00 2001 From: babu Date: Thu, 25 Jan 2024 10:16:00 +0100 Subject: [PATCH] removing caching for heuristics, more cache misses than hits --- pathfinding3d/core/heuristic.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/pathfinding3d/core/heuristic.py b/pathfinding3d/core/heuristic.py index ed8f6df..dfeba8f 100644 --- a/pathfinding3d/core/heuristic.py +++ b/pathfinding3d/core/heuristic.py @@ -1,5 +1,4 @@ import math -from functools import lru_cache from typing import Union from .util import SQRT2_MINUS_1, SQRT3_MINUS_SQRT2 @@ -49,7 +48,6 @@ def manhattan(dx: Union[int, float], dy: Union[int, float], dz: Union[int, float return dx + dy + dz -@lru_cache(maxsize=128) def euclidean(dx: Union[int, float], dy: Union[int, float], dz: Union[int, float]) -> float: """Euclidean distance heuristics @@ -90,7 +88,6 @@ def chebyshev(dx: Union[int, float], dy: Union[int, float], dz: Union[int, float return max(dx, dy, dz) -@lru_cache(maxsize=128) def octile(dx: Union[int, float], dy: Union[int, float], dz: Union[int, float]) -> float: """Octile distance.