in a way, it's silly to compare speed at this level. Lingo is an
interpreted language, and as such is inherently slower than other,
system-level languages. If speed is a priority, Director and Lingo might
not be the best choice.
Of course one should optimize code as much as possible, but my point is
that the advantages one gets from using dot syntax outweigh the speed
disadvantages, especially when you compare both to other languages. 

--bh

zac wrote:
> 
> Terry R. Schussler wrote:
> 
> > One of the results from the test was that dot notation
> > operations *can* be slower.
> 
> Part of that is because bracket access (object[#prop]) is slower that dot
> access (object.prop)
> 
> In your on getFromPropListDotNotationStyle handler you use bracket access
> 
> name = proplist[#pName]
> address = proplist[#pAddress]
> city = proplist[#pCity]
> state = proplist[#pState]
> zip = proplist[#pZip]
> 
> but if you change that to dot access the code speeds up considerably.
> 
> name = proplist.pName
> address = proplist.pAddress
> city = proplist.pCity
> state = proplist.pState
> zip = proplist.pZip
> 
> Using your original code I got times of (unsorted: 386, sorted: 408) and
> using dot access I got (unsorted: 115 and sorted: 382)
> 
> The unsorted list access was dramatically faster using dot access as opposed
> to bracket access.
> 
> And, similarly, the times for accessing the script object and script
> instance decreased as well
> 
> type                                                  time
> script object bracket                      145
> script object dot                             111
> 
> script instance bracket                  154
> script instance dot                         108
> 
> --
> 
> Every cloud has its silver lining, and lightning kills hundreds of
> people each year who are trying to find it.
> 
> email: [EMAIL PROTECTED]
> web: http://www.pixelgeek.com/
> 
> [To remove yourself from this list, or to change to digest mode, go to
> http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
> email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
> Lingo-L is for learning and helping with programming Lingo.  Thanks!]

-- 
R. Bhakti Klein
Lingo Programmer, Scientific Learning
http://www.ScientificLearning.com
http://www.BrainConnection.com
**
Baritone, Wicki6
http://www.wicki6.com
***
"On Earth, you can only do little things;
but you can do them with a lot of Love."
                              -- Mother Theresa

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to