[erlang-questions] trading systems

Michael Truog mjtruog@REDACTED
Fri Oct 2 08:38:05 CEST 2009


Alpar Juttner wrote:
>>> Why? I interviewed with a hedge fund. They use templates extensively  
>>> and it makes sense. Partial template specialization is just the  
>>> ticket to optimize generic code at compile time.
>>>       
>> Templates can drastically inflate code size
>>     
>
> It doesn't true today, due to inlining and optimization. Consider for
> example 'std::vector<int> a;'. If you hane look at the header file you
> will see that a single statement like 'a[5]=12;' results in a tremendous
> amount of (nested) function calls. But the optimizer will reduce it to
> same machine code as the corresponding C expression would result in.
>   
I agree that templates are generally fine now that we have compilers
better than g++ 2.95, and that we are reaching the new C++ changes with
tr1/C++0x or what will soon be C++1x.  I think the main problems I have
seen with templates inflating code size have related to static
data/methods within the template class, so it is an issue with proper
design of the system (not the language itself).




More information about the erlang-questions mailing list