Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news-peer.in.tum.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Wolfgang Riedmann" Newsgroups: comp.lang.clipper.visual-objects Subject: Re: Self:Variable vs parameter Date: 29 Aug 2012 15:21:25 GMT Lines: 30 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Trace: individual.net AMIXze+JnwNz4Qg3uqWMew3slwN58Z4zj7GSNisDtzRyv0XpbCSoF6FGns8o7ErbM= Cancel-Lock: sha1:uMl5F9HRYjUgALLEEdGVvIGDnBA= User-Agent: XanaNews/1.18.1.6 Xref: csiph.com comp.lang.clipper.visual-objects:4011 Hi Martin, > Which is better for performance? > > Using Self:something in a class or sending something as a parameter > into each method? If your code is: oObject:SomeThing := oSomeThing oObject:ExecuteMethod() the following may be have a slightly bit better performance oObject:ExecuteMethod( oSomething ) but only if ExecuteMethod is strong typed. If ExecuteMethod() cannot be strong typed, you should assign oSomething to a local typed variable as first thing, so the compiler can generate better code. If you need the same Something object more times, then an assign to an instance variable (export or protect) is better because every parameter passing requires time. HTH Wolfgang