Re: Which is faster...
That is not exactly the test he was looking for. He wants to compare retrieving an array from a script local variable vs. getting a property of an object like a stack, that contains the same array. At least I think that is the question. Now I’d like to discuss virtual properties. It takes the form: Local lValueA setProp myVirtualProperty, pValueA Put pValueA into lValueA End setProp The reason this is really handy is because if pValueA is an array, you can then use the form: getProp myVirtualProperty [pKey] If pKey is not empty then Return lValueA [pKey] Else Return tValueA End getProp In other words, you can get elements of the array without getting the entire array itself i.e.: Put the myVirtualProperty [“companyname”] of myLivecodeObject into tCompanyName I use this quite extensively. I have a single card which contains all the currently queried database data for caching purposes, along with the currently selected indexes for each datagrid, and the currently selected primary keys. I call the getProp and setProp handlers maingriddata. So I can: Get the maingriddata [“hilitedkeys”] of tMainCard Get the maingriddata [“hilitedindexes”] of tMainCard Get the maingriddata [“customers”] Put the queriedCustomersA into tMainGridDataA Set the maingriddata to tMainGridDataA And so forth. Any kind of logic can be used in the getProp and setProp handlers. Bob S > On Dec 14, 2023, at 2:25 PM, Craig Newman via use-livecode > wrote: > > Anything to distract me from my day job. > > An array with 100,000 elements and a variable with 100,00 lines take the same > time to place into a field. > > The only time that took a while was building them. Each took 10 milliseconds. > > Craig > >> On Dec 14, 2023, at 4:55 PM, Paul Dupuis via use-livecode >> wrote: >> >> Bob, >> >> Thank you. I could script a timing test but sometime just asking the list or >> forums is easier. You asnwered well before I would have had the time to >> write a basic test script. Thanks! >> >> >> On 12/14/2023 4:45 PM, Bob Sneidar via use-livecode wrote: >>> I think the confusion comes from thinking so much of a stack as an object >>> that has substance, when really all the properties are places in memory >>> just like a memory variable is. I asked this some years back and the answer >>> I got was that there is no appreciable difference. >>> >>> One could always devise a test though… >>> >>> Bob S >>> >>> >>> On Dec 14, 2023, at 1:22 PM, Paul Dupuis via use-livecode >>> wrote: >>> >>> Which is faster or more efficient (from an engine performance perspective)? >>> >>> To retrieve an array from a property? >>> As in: >>> command someHandler -- in an objects script >>> get the cMyArray from me -- cMyArray is some multi-dimensional array >>> ... >>> end someHandler >>> >>> OR >>> >>> To retrieve an array from a script local variable? >>> As in: >>> local sMyArray -- script local variable in some objects script >>> >>> command someHandler -- in an objects script >>> get sMyArray >>> ... >>> end someHandler >>> >>> Anyone know? >>> >>> ___ >>> use-livecode mailing list >>> use-livecode@lists.runrev.com >>> Please visit this url to subscribe, unsubscribe and manage your >>> subscription preferences: >>> http://lists.runrev.com/mailman/listinfo/use-livecode >> >> >> ___ >> use-livecode mailing list >> use-livecode@lists.runrev.com >> Please visit this url to subscribe, unsubscribe and manage your subscription >> preferences: >> http://lists.runrev.com/mailman/listinfo/use-livecode > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Which is faster...
Laziness in the last post. BOTH took 10 mS to fill an ordinary variable. Craig > On Dec 14, 2023, at 5:32 PM, Craig Newman wrote: > > Typo in the last post. BOTH had 100,000 elements or lines. > > Craig > >> On Dec 14, 2023, at 5:25 PM, Craig Newman wrote: >> >> Anything to distract me from my day job. >> >> An array with 100,000 elements and a variable with 100,00 lines take the >> same time to place into a field. >> >> The only time that took a while was building them. Each took 10 milliseconds. >> >> Craig >> >>> On Dec 14, 2023, at 4:55 PM, Paul Dupuis via use-livecode >>> wrote: >>> >>> Bob, >>> >>> Thank you. I could script a timing test but sometime just asking the list >>> or forums is easier. You asnwered well before I would have had the time to >>> write a basic test script. Thanks! >>> >>> >>> On 12/14/2023 4:45 PM, Bob Sneidar via use-livecode wrote: I think the confusion comes from thinking so much of a stack as an object that has substance, when really all the properties are places in memory just like a memory variable is. I asked this some years back and the answer I got was that there is no appreciable difference. One could always devise a test though… Bob S On Dec 14, 2023, at 1:22 PM, Paul Dupuis via use-livecode wrote: Which is faster or more efficient (from an engine performance perspective)? To retrieve an array from a property? As in: command someHandler -- in an objects script get the cMyArray from me -- cMyArray is some multi-dimensional array ... end someHandler OR To retrieve an array from a script local variable? As in: local sMyArray -- script local variable in some objects script command someHandler -- in an objects script get sMyArray ... end someHandler Anyone know? ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode >>> >>> >>> ___ >>> use-livecode mailing list >>> use-livecode@lists.runrev.com >>> Please visit this url to subscribe, unsubscribe and manage your >>> subscription preferences: >>> http://lists.runrev.com/mailman/listinfo/use-livecode >> > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Which is faster...
Typo in the last post. BOTH had 100,000 elements or lines. Craig > On Dec 14, 2023, at 5:25 PM, Craig Newman wrote: > > Anything to distract me from my day job. > > An array with 100,000 elements and a variable with 100,00 lines take the same > time to place into a field. > > The only time that took a while was building them. Each took 10 milliseconds. > > Craig > >> On Dec 14, 2023, at 4:55 PM, Paul Dupuis via use-livecode >> wrote: >> >> Bob, >> >> Thank you. I could script a timing test but sometime just asking the list or >> forums is easier. You asnwered well before I would have had the time to >> write a basic test script. Thanks! >> >> >> On 12/14/2023 4:45 PM, Bob Sneidar via use-livecode wrote: >>> I think the confusion comes from thinking so much of a stack as an object >>> that has substance, when really all the properties are places in memory >>> just like a memory variable is. I asked this some years back and the answer >>> I got was that there is no appreciable difference. >>> >>> One could always devise a test though… >>> >>> Bob S >>> >>> >>> On Dec 14, 2023, at 1:22 PM, Paul Dupuis via use-livecode >>> wrote: >>> >>> Which is faster or more efficient (from an engine performance perspective)? >>> >>> To retrieve an array from a property? >>> As in: >>> command someHandler -- in an objects script >>> get the cMyArray from me -- cMyArray is some multi-dimensional array >>> ... >>> end someHandler >>> >>> OR >>> >>> To retrieve an array from a script local variable? >>> As in: >>> local sMyArray -- script local variable in some objects script >>> >>> command someHandler -- in an objects script >>> get sMyArray >>> ... >>> end someHandler >>> >>> Anyone know? >>> >>> ___ >>> use-livecode mailing list >>> use-livecode@lists.runrev.com >>> Please visit this url to subscribe, unsubscribe and manage your >>> subscription preferences: >>> http://lists.runrev.com/mailman/listinfo/use-livecode >> >> >> ___ >> use-livecode mailing list >> use-livecode@lists.runrev.com >> Please visit this url to subscribe, unsubscribe and manage your subscription >> preferences: >> http://lists.runrev.com/mailman/listinfo/use-livecode > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Which is faster...
On 12/14/2023 5:25 PM, Craig Newman via use-livecode wrote: Anything to distract me from my day job. Glad I could help! And thank you for the confirming benchmarks! ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Which is faster...
Anything to distract me from my day job. An array with 100,000 elements and a variable with 100,00 lines take the same time to place into a field. The only time that took a while was building them. Each took 10 milliseconds. Craig > On Dec 14, 2023, at 4:55 PM, Paul Dupuis via use-livecode > wrote: > > Bob, > > Thank you. I could script a timing test but sometime just asking the list or > forums is easier. You asnwered well before I would have had the time to write > a basic test script. Thanks! > > > On 12/14/2023 4:45 PM, Bob Sneidar via use-livecode wrote: >> I think the confusion comes from thinking so much of a stack as an object >> that has substance, when really all the properties are places in memory just >> like a memory variable is. I asked this some years back and the answer I got >> was that there is no appreciable difference. >> >> One could always devise a test though… >> >> Bob S >> >> >> On Dec 14, 2023, at 1:22 PM, Paul Dupuis via use-livecode >> wrote: >> >> Which is faster or more efficient (from an engine performance perspective)? >> >> To retrieve an array from a property? >> As in: >> command someHandler -- in an objects script >> get the cMyArray from me -- cMyArray is some multi-dimensional array >> ... >> end someHandler >> >> OR >> >> To retrieve an array from a script local variable? >> As in: >> local sMyArray -- script local variable in some objects script >> >> command someHandler -- in an objects script >> get sMyArray >> ... >> end someHandler >> >> Anyone know? >> >> ___ >> use-livecode mailing list >> use-livecode@lists.runrev.com >> Please visit this url to subscribe, unsubscribe and manage your subscription >> preferences: >> http://lists.runrev.com/mailman/listinfo/use-livecode > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Which is faster...
Bob, Thank you. I could script a timing test but sometime just asking the list or forums is easier. You asnwered well before I would have had the time to write a basic test script. Thanks! On 12/14/2023 4:45 PM, Bob Sneidar via use-livecode wrote: I think the confusion comes from thinking so much of a stack as an object that has substance, when really all the properties are places in memory just like a memory variable is. I asked this some years back and the answer I got was that there is no appreciable difference. One could always devise a test though… Bob S On Dec 14, 2023, at 1:22 PM, Paul Dupuis via use-livecode wrote: Which is faster or more efficient (from an engine performance perspective)? To retrieve an array from a property? As in: command someHandler -- in an objects script get the cMyArray from me -- cMyArray is some multi-dimensional array ... end someHandler OR To retrieve an array from a script local variable? As in: local sMyArray -- script local variable in some objects script command someHandler -- in an objects script get sMyArray ... end someHandler Anyone know? ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Which is faster...
I think the confusion comes from thinking so much of a stack as an object that has substance, when really all the properties are places in memory just like a memory variable is. I asked this some years back and the answer I got was that there is no appreciable difference. One could always devise a test though… Bob S On Dec 14, 2023, at 1:22 PM, Paul Dupuis via use-livecode wrote: Which is faster or more efficient (from an engine performance perspective)? To retrieve an array from a property? As in: command someHandler -- in an objects script get the cMyArray from me -- cMyArray is some multi-dimensional array ... end someHandler OR To retrieve an array from a script local variable? As in: local sMyArray -- script local variable in some objects script command someHandler -- in an objects script get sMyArray ... end someHandler Anyone know? ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Which is faster...
Which is faster or more efficient (from an engine performance perspective)? To retrieve an array from a property? As in: command someHandler -- in an objects script get the cMyArray from me -- cMyArray is some multi-dimensional array ... end someHandler OR To retrieve an array from a script local variable? As in: local sMyArray -- script local variable in some objects script command someHandler -- in an objects script get sMyArray ... end someHandler Anyone know? ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
OT: htmx and hyperscript
As I was looking into htmx (which is basically going in the opposite direction to that which Livecode is taking with WASM), I discovered the author of htmx has also implemented a kind of hypertalk in the browser (the point being to more simply hook into DOM events). It looks rather ugly IMO (unlike htmx). But I know people on this list are often interested in descendants/hat-tips to Hypercard. https://hyperscript.org/ Regards, Bernard ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode