2 ms·
Which more or less removes any benefit for using optional, unfortunately.
by yoklov 11y ago
Which more or less removes any benefit for using optional, unfortunately.
- deleted 11y ago[deleted]
- imron 11y agoYes for this case, but that's just because it's a bad example for comparing the performance of optional, because the code is doing things that have very different performance characteristics. There are plenty of other cases though where it is useful to use optional (e.g. instead of passing/returning a naked pointer which may or may not be null) and in those cases use of optional will have little/no overhead.