[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] Performance: C contra ADA



On Tue, Mar 02, 2004 at 02:12:58PM +0100, Michael Rasmussen wrote:
> Hej alle,
> 
> Et lidt langhåret spørgsmål rent sprogdesign mæssigt:
> 
> I C foregår parameteroverførsel med call-by-reference,
Øh? Hvor har du fået den ide fra? I C har du kun mulighed for at lave
call-by-value. I C++ kan man lave call-by-reference ved at sætte & foran
variabel navnet.

> mens det for ADA
> gælder, at parameteroverførsel laves med call-by-copy/restore. Ifølge
> min købmandsregning burde det derfor være indlysende, at
> parameteroverførsel i ADA er en dyr instruktion rent performancemæssigt!
Tjoo... Det kommer an på hvilke funktioner det er der bliver kaldt.
F.eks. er call-by-value hurtigere i nogle situationer, hvis parameterene
til funktionen er heltal. Det er fordi man så ikke behøver at dereferere
en pointer, og læse hukommelspladsen hvor den er gemt, men istedet bare
kan bruge registre til at overføre den. 

-- 
/-----------------------------------------------------\
| Klaus S. Madsen      | "Failure is not an option... |
| ICQ: 45400164        |  It comes bundled with your  |
| www.hjernemadsen.org |  Microsoft products!"        |
\-----------------------------------------------------/


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:43 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *