MUD-Dev
mailing list archive
[ Other Periods
| Other mailing lists
| Search
]
Date:
[ Previous
| Next
]
Thread:
[ Previous
| Next
]
Index:
[ Author
| Date
| Thread
]
Re: [MUD-Dev] Languages
[Ben G:]
:I'm curious about some things. What exactly makes c++ slower? Is it
:more class calls because most ppl make accessing class data a function
:call? Perhaps inheritance mapping of some sort? I head that a c++
:compiler basically just translates the code into c before compile anyway..
The larger number of function calls (at the implementation level) is one
of the biggest slow-downs, I think. Asside from the obvious effect of
executing more instructions, that type of code slows modern CPUs down
even more because it is hard on the instruction cache and on any branch
prediction and look-ahead stuff. I don't know if there any CPUs yet that
can successfully look-ahead through a C++ virtual function call, but I
doubt it. That pretty well shuts off a lot of look-ahead and pipelining
until that call has been resolved. Having lots of small functions (many
of which don't don't actually do anything useful!) results in lots of
instruction cache misses, resulting in execution closer to main memory
speed rather than CPU clock speed.
--
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA
- Thread context:
- Re: [MUD-Dev] Languages, (continued)
- Re: [MUD-Dev] Languages,
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA, Fri 23 May 1997, 13:02 GMT
- Re: [MUD-Dev] Languages,
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA, Fri 23 May 1997, 13:03 GMT
- Re: [MUD-Dev] Languages,
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA, Fri 23 May 1997, 14:04 GMT
- Re: [MUD-Dev] Languages,
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA, Sat 24 May 1997, 12:06 GMT
- Re: [MUD-Dev] Languages,
Jeff Kesselman jeffk#tenetwork,com, Sat 24 May 1997, 14:10 GMT
[ Other Periods
| Other mailing lists
| Search
]