xcode backend: make the type of get_target_dir align with parent class
mypy will complain if backends.Backend has a lru_cache wrapped method,
but it is overridden in XCodeBackend with a method that isn't cached.
This is almost certainly a sign that we should be caching it here too
anyway. The generic backend cache was added years ago via an
intimidating commit f39d2cc3bf
which
claims that it reduced call time from 60s to 0.000435s and that this was
specifically due to getting a coredata option every single time. This is
probably workload dependent, but getting an option is *not* nearly as
cheap as a throwaway function call.
This commit is contained in:
parent
d8a6bf9352
commit
ff7a997f48
|
@ -13,7 +13,7 @@
|
|||
# limitations under the License.
|
||||
from __future__ import annotations
|
||||
|
||||
import uuid, os, operator
|
||||
import functools, uuid, os, operator
|
||||
import typing as T
|
||||
|
||||
from . import backends
|
||||
|
@ -226,6 +226,7 @@ class XCodeBackend(backends.Backend):
|
|||
def gen_id(self) -> str:
|
||||
return str(uuid.uuid4()).upper().replace('-', '')[:24]
|
||||
|
||||
@functools.lru_cache(maxsize=None)
|
||||
def get_target_dir(self, target):
|
||||
dirname = os.path.join(target.get_subdir(), T.cast('str', self.environment.coredata.get_option(OptionKey('buildtype'))))
|
||||
#os.makedirs(os.path.join(self.environment.get_build_dir(), dirname), exist_ok=True)
|
||||
|
|
Loading…
Reference in New Issue