Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Speed of 'const' in procedure / function

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
Would I benefit in performance by setting my procedures to be of the following definition :

procedure Process1(const pParam1 : Integer; const pParam2 : String)

instead of :

procedure Process1(pParam1 : Integer; pParam2 : String)

If I am sure that I will not be changing the values of the parameters within the scope of the procedure(s) (in which case I would pass the parameters in as 'var').
Would I see better performance if I was indicating that these parameters are 'const' ?
Thanks in advance
Steve
 
As far as I know, the difference isn't significant unless the procedure is called a huge amount of times or the system is meant to be real time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top