Skip to content

Commit

Permalink
removing caching for heuristics, more cache misses than hits
Browse files Browse the repository at this point in the history
  • Loading branch information
hariIVI committed Jan 25, 2024
1 parent b0da731 commit eb2de6b
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions pathfinding3d/core/heuristic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import math
from functools import lru_cache
from typing import Union

from .util import SQRT2_MINUS_1, SQRT3_MINUS_SQRT2
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit eb2de6b

Please sign in to comment.