An elegant pattern to craft cache-efficient functions in Swift

In this post, Vincent Pradeilles describes how we can create Swift functions which cache their results, saving us valuable CPU cycles. Vincent looks at both non-recursive and recursive functions.