Похожие чаты

What will have a higher performance? overloaded functions that you

route via casted object type parameter.. or an if else branch tree where you route based on object type again

9 ответов

8 просмотров

Branching is rather slow - especially if you arent careful in your probabilities. (templated-)Overloaded functions are evaluated at compile time, hence why your code takes a while to compile when you have many different template-types

Yamikani-᥀ Автор вопроса
BinaryByter
Branching is rather slow - especially if you arent...

but say if i have 36 types here.. functions compiled will be 36, don't think their layout will be much faster than branching it..will it?

Yamikani ᥀
but say if i have 36 types here.. functions compil...

The compile time of 36 functions is quite high, but calling one function is much faster than having 36 if's

BinaryByter
The compile time of 36 functions is quite high, bu...

You have more used RAM and a slightly bigger file (this behaviour scales linearly) and the compile time is slower

Thomas
citation needed

Compiling 36 variants of a functions takes more time than compiling one variant - where am I overlooking something?

BinaryByter
Compiling 36 variants of a functions takes more ti...

Ahh I thought you were talking about runtime performance

Yamikani-᥀ Автор вопроса
BinaryByter
You have more used RAM and a slightly bigger file ...

hope you are right.. any links if you remember even tangential to this?

Похожие вопросы

Обсуждают сегодня

А как старый хаскел с новым стыковать ? потому как тут работает https://play.haskell.org/saved/C3xpMzcd, а вот тут https://stepik.org/lesson/7602/step/9?unit=1473 нет ошибка C...
Fedor
131
Вопрос я правильно понимаю что в коде newtype ArrowMap k v = ArrowMap { getArrowMap :: k -> Maybe v } getArrowMap есть функция типа k -> Maybe v, если да, то не понимаю задач...
Fedor
64
I am honored to report that all the deliverables for the BCHFAQ Flipstarter Phase 1 have been completed. I appreciate the opportunity I've had to put all this together using t...
fixthetracking
15
Как Вы считаете нормально ли в двадцатых годах 21 века в ВУЗах Российской Федерации обучать студентов работе с TASM? Не слишком ли это "архаично"? (Если оффтоп или флейм для э...
Spiker01
52
Hey guys, I'm new in this group, but I've had DVPN for a little while now. Any new updates or anything to look forward to? How we feeling about everything?
Steve G
16
Продолжая диалог про свифт в проде – сейчас возник вопрос в активном наборе бекендеров. В основном в нашей компании мы фанаты Java Spring и полностью ей довольны. Однако найм ...
Guseyn
27
Кто-нибудь знает, как считается нагрузка на цпу? И что такое вообще "нагрузка на цпу"? вот, например, есть у цпу какой-то clock, настроенный на 3 ГГц --- Что значит "нагрузка...
Toideng
15
Можно ли написать свою библиотеку "socket" на каком либо языке ассемблера с нуля не используя сишние библиотеки ? Или это самоубийство ?
123🪐
15
Is there any new news from Kadena? The price is very suppressed.
HAKAN TECİMEN
27
Комрады, хотел уточнить. Проперть в OnDestroy юнита-хозяина по-прежнему доступна? И еще уточнение: finalization юнита наступает раньше или позже OnDestroy?
Ed Doc
48
Карта сайта