There is not going to really ever be a performance comparison to make here. Performance issues arise when something is happening multiple times per millisecond and they need to be optimized.
That is not that case here. The information for the key is going to be coming from an event. Events are not caused very often (at least not when compared with millisconds) and so any sort of approach to optimization will not have any benefit.
2
solved Caching a value or calling function – what is better?