Adding Caching
You might be concerned that this approach creates additional performance overhead
because we’re redefining the same functions on every call. Bear in mind, however,
that when we’re applying functional mixins to prototypes, the work only needs to be
done once: during the definition of the constructors. The work required for instance
creation is unaffected by the mixin process, since all the behavior is preassigned to the
shared prototype. This is how we support all function sharing on the twitter.com site,
and it produces no noticeable latency. Moreover, it’s worth noting that performing a
classical mixin requires property getting ...