questions on PhanTango 'merger' (was Merging Tangobos into Tango) - long-term vision

BCS ao at pathlink.com
Thu Oct 11 22:12:09 PDT 2007


Reply to kris,

> "BCS" <ao at pathlink.com> wrote in message
> 
> [snip]
> 
>> I'm a cycle snob. How hard it is to code, how hard it is to get it to
>> do what I want and *how long it takes to run* are of equal importance
>> to me. With tango's use of chained calls (not exactly free from a
>> performance standpoint) is a small minus in my book.
>> 
> This is worth discussing, since I'm sometimes a cycle-snob also :)
> 
> Chained calls actually cost /less/, since the dispatch is decided at
> compile-time rather than runtime. In other words, chained-calls don't
> have to go through a big switch statement to figure out the type and
> dispatch based upon that. Thus, purely from a runtime cycle-count,
> chained calls really /are/ more efficient (for the kind of thing we
> are talking about). This is one of the reasons why Tango uses chained
> calls in some aspects of the IO model.
> 
> :p
> 

interesting. I would say this indicates a defect in something. Either the 
implementation of switch or the TypeInfo stuff. The number of different choices 
that writef has to chouse from is only around a dozen or so. I would expect 
that the compiler should be able to get that switch down to a few ops and 
a table lookup.

BTW how does DMD implement switches for integers? some sort of perfect hash 
generator and a table lookup?





More information about the Digitalmars-d mailing list