David Vaughan wrote: > I personally find this a strange discussion. Firstly, I would rather be > warning newbies if local variables did *not* lose their value on > recompilation, and secondly, why write code to emulate some features of > custom properties when you can use them directly? If you need that > millisecond of speed by which access to a local is faster than to a > custom prop then use your startup, preopen or open handler to populate > the script locals from the custom properties, and save back the values > at end, to cater for changes. Through use of custom props, script > locals and ordinary variables, I have been able to relegate globals to > very rare usage, when you actually want a non-persistent entirely > global variable. Rev is quite rich in scoping and persistence options.
<OCD mode> Benchmarking the difference between local vars and custom props with RevBnch (downloadable from <http://www.fourthworld.com/rev/>), here's the results: SCRIPT 1 put "value" into tMyVar get tMyVar 0.0002 ticks per iteration SCRIPT2 set the uMyProp of this cd to "value" get the uMyProp of this cd 0.0008 ticks per iteration So while using local vars is about 75% faster, the real-world difference in runtime execution is trivial compared to the cost savings in developmewnt time that can be had by binding data to objects. To be honest, the Rev/MC engine is so darn fast that I rarely do this sort of comparative benchmarking anymore, as I often find -- as with this case -- that the runtime differences are negliible. </OCD mode> -- Richard Gaskin Fourth World Media Corporation Developer of WebMerge 2.2: Publish any database on any site ___________________________________________________________ [EMAIL PROTECTED] http://www.FourthWorld.com Tel: 323-225-3717 AIM: FourthWorldInc _______________________________________________ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
