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.

How much extra overhead do generics have?

extra generics overhead
0
10 Posted

How much extra overhead do generics have?

0

If you overgeneralize the generic, there will be more work to do for

0

If you overgeneralize the generic, there will be more work to do for the compiler. How do you know when you have overgeneralized? For instance, passing arithmetic operations as parameters is a bad sign. So are boolean or enumeration type generic formal parameters. If you never override the defaults for a parameter, you probably overengineered. Code sharing (if implemented and requested) will cause an additional overhead on some calls, which will be partially offset by improved locality of reference. (Translation, code sharing may win most when cache misses cost most.) If a generic unit is only used once in a program, code sharing always loses. R.R. Software chose code sharing as the implementation for generics because 2 or more instantiations of Float_Io in a macro implementation would have made a program too large to run in the amount of memory available on the PC machines that existed in 1983 (usually a 128k or 256k machine). Generics in Ada can also result in loss of information whi

Related Questions

What is your question?

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

Experts123