Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Using classes is slower than structs, right?

classes right slower structs
0
Posted

Using classes is slower than structs, right?

0

• A: Heap activity will reduce the efficiency of any program. This is partly why D supports placing classes on the stack, via the scope keyword. However, the heap can be abused in many (often subtle) ways, so it would be grossly over-simplified to point a finger at the use of class alone. Tango is designed with an explicit goal of limiting the amount of hidden heap activity – if you find a case where that does not hold true, please tell us about it.

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123