2 ms·
> Now I suffer both the noise of the unabstracted thing, and an extra assignment. Depends on your goals / constraints. From a performance standpoint, the attri
by sgarland 2y ago
> Now I suffer both the noise of the unabstracted thing, and an extra assignment.
Depends on your goals / constraints. From a performance standpoint, the attribute lookups can often dwarf the overhead of an extra assignment.
- joshuamorton 2y agoI'm speaking solely from a developer experience perspective. We're talking about cases where the expression is only used once, so the assignment is free/can be trivially inlined, and the attribute lookups are also only used once so there is nothing saved by creating a temporary for them.