Skip to content

Commit

Permalink
perf: Cache register plugin function (#18860)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli authored Sep 23, 2024
1 parent b68e259 commit 48c1262
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions py-polars/polars/plugins.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import contextlib
from functools import lru_cache
from pathlib import Path
from typing import TYPE_CHECKING, Any, Iterable

Expand Down Expand Up @@ -111,6 +112,7 @@ def _serialize_kwargs(kwargs: dict[str, Any] | None) -> bytes:
return pickle.dumps(kwargs, protocol=5)


@lru_cache(maxsize=16)
def _resolve_plugin_path(path: Path | str) -> Path:
"""Get the file path of the dynamic library file."""
if not isinstance(path, Path):
Expand Down

0 comments on commit 48c1262

Please sign in to comment.