Kirk: I did some timing tests on dotted notation with C_Object, the OBJ_ module, and my routines that use wrappered Object Tools commands.
"Ain't nuthin' slow at 4.2 Ghz" Even running interpreted code, there was no perceptible difference in performance of a few hundred or thousand iterations. When compiled, I'd had to have gone to significant measures to introduce a meaningful difference but the accessor methods that were calling wrapped ObjectTools commands started to lag (timing in milliseconds). For the systems that I work on, I have no qualms about using what's convenient. BTW, I mimicked the OT GetArrayLong/Text/Date* commands and the Find in array command from Object Tools in my copy of OBJ_Module. The approach that I took was to extract the array from the object and do a find in array and I was thinking that, perhaps, that would incur a penalty. I don't have the metrics handy but, until it got into the thousands of hits, the operation was essentially instantaneous. And the reason, as 4D has pointed out over the years, is that we're dealing with references to data not the actual data itself so it's not a question of moving data in memory. We're a long way from the days of upgrading to a PowerTower 225 to get the most speed. :-) *Those ObjectTools commands index into an array embedded in an OT object and return the value from the array so they can be used in a manner similar to how ForEach works. -- Douglas von Roeder 949-336-2902 On Wed, Oct 3, 2018 at 10:57 AM Kirk Brooks via 4D_Tech < [email protected]> wrote: > Jim, > In v15 I frequently use something like: > > OB SET($obj;\ > k some key; "the value";\ > k another key; "another value") > > And so on. This also worked with Canon's OBJ module: > OBJ_SET_TEXT($obj;k some dot notation key;"text to set") > where: k some dot notation key = "a.b.c" > > In v17 to do that using native dot notation you would have: > $obj[k some key]:="the value" > $obj[k another key]:="another value" > > There isn't a direct equivalent for using dot notation the way we do using > the OBJ module. > > This isn't really a problem I suppose I'm just not as comfortable with it. > Yet, anyway. It may prove to be a good way to go but I suspect it's a > little bit slower than directly referencing the object especially if you > get several levels deep or are looping a large collection. > > $obj[k level 1].[k level 2].[k level 3]:="the value" > At this point the code is becoming pretty unreadable. At least difficult to > debug. > > I feels like it's not going to be the best solution but it's mainly a > personal preference at this point. It seems like overloading the code with > a lot of error checking that would best be done another way. > > On Wed, Oct 3, 2018 at 10:38 AM Jim Dorrance via 4D_Tech < > [email protected]> wrote: > > > Why are constants less useful? If the value is equal to the constant, it > > avoids potential upper/lower case problems, no? > > > > -- > Kirk Brooks > San Francisco, CA > ======================= > > *We go vote - they go home* > ********************************************************************** > 4D Internet Users Group (4D iNUG) > Archive: http://lists.4d.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:[email protected] > ********************************************************************** ********************************************************************** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:[email protected] **********************************************************************

