| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Passing a var. |
G'Day Paul,
-=> Quoting Paul Edwards to Frank Adam <=-
PE> Show me the C++ code you think would be slower if written in C. Or
PE> better still, write both the C and C++ versions, and have a look
PE> at the assembler generated for each, and look at the
PE> relative code. They should be the same (speedwise). BFN.
FA> NO WAY, NO HOW am i getting into a C vs. C++ argument,
FA> but if i had to use
PE> Doing "performance tuning" without the grottiness of
PE> actually using profiler, looking at assembler etc, eh? :-)
I'm not all that paranoid about speed in textmode. Did you have to do a
lot of tuning on Msged, and if so was it worth it ?
Talking about profilers, with release 4++ on, Borland decided that we
don't need one anymore. I tend to disagree, so do you know of a generic
profiler ? (if there can be such thing)
My TurboC prof won't touch the BC4 code, perhaps it knows s'thing.:)
FA> structures and pass them to individual functions, i would assume that a
FA> single class using local(to it) variables would speed things up.
PE> How did you think those C++ functions would know which
PE> object they were acting on? ESP? Just happened to be
PE> sitting in a register, guv'ner.
I thought about that too after i've posted it.
FA> Isn't David (our C++ guru) going to help me out here ? :-)
PE> When a duck is dead, it doesn't quack anymore.
Quack.
PE> You do realise that the original C++ was just a translator that
PE> produced C code, don't you? Ergo, whatever was done in C++ can be
No i didn't. By the time i got to it, it had virtual functions,
overloading etc..
AMOF o/loading has to be the most appealing thing (to me) about C++.
PE> done in C. In the above case, going x.func() is the
PE> equivalent of going xfunc(&x). Or at least, that's my
PE> understanding of it. BFN. Paul.
From what i could gather and understand from the asm outputs, the C++ spends
a fair bit of time setting up data tables, and then just becomes a big
function(inline ?)
It does look more efficient from there on. But that setting tables business
took about a 1/4 of the assmebly space.
Then again me and assembly...
L8r Frank (fadam{at}ozemail.com.au).
--- Gash
* Origin: The Software Parlour (3:635/544)SEEN-BY: 50/99 620/243 623/630 632/349 635/503 544 727 711/401 409 410 413 SEEN-BY: 711/430 808 809 932 934 712/515 713/888 714/906 800/1 @PATH: 635/544 50/99 711/808 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.