≈ the.bay.news

KeyPath to String: Efficient runtime conversion alternatives?

Swift Forums
KeyPath to String: Efficient runtime conversion alternatives?
Hi everyone, I am working on a library where a dictionary-like data structure consumes instance property values using a list of key-paths. To use these key-paths as keys, I need to convert them into strings. However, I noticed that using String(reflecting:) is roughly 295 times slower than assigning values using a hardcoded string subscript. When writing a large number of properties, this overhead accumulates into a noticeable millisecond-range delay. If the overhead of using key-paths were, ...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.