Functional options are slow
·
Link:: https://www.evanjones.ca/go-functional-options-slow.html
**TL;DR: ** For the “direct” call, the overhead of functional options is low: a few extra nanoseconds per call. However, when calling via an interface, the compiler is required to heap allocate the slice argument, so the functional options version is about 5× slower. The difference gets even larger as more options are passed.
Обратные ссылки
Избранные статьи
Все сохранённые избранные статьи для чтения, включая опубликованные в Chernov sharit.