foundeo / cfdocs

Repository for the cfdocs.org site.
https://cfdocs.org/
Other
184 stars 344 forks source link

Update arraynew.json #1645

Closed pczarn2 closed 7 months ago

pczarn2 commented 7 months ago

Correct default value for isSynchronized argument; remove no longer working link to Adobe white paper; correct Create unsynchronized array example. Reference: https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-a-b/arraynew.html

pfreitag commented 7 months ago

@pczarn2 - did you check to see if there is another link to that PDF, perhaps archive.org may have it?

pczarn2 commented 7 months ago

@pfreitag Adobe's own website has the link, but that link is broken (https://helpx.adobe.com/coldfusion/white-papers.html). Archive.org has the webpage, but the link to PDF is broken there as well. There were other pages that have the same broken link. I did find some working links here, but it's in Japanese, so not too useful to me :) Not sure where else to check.

https://www.google.com/search?q=CF2016_Performance.pdf&oq=CF2016_Performance.pdf&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIGCAEQRRg8MgYIAhBFGDzSAQc3MThqMGoxqAIAsAIA&sourceid=chrome&ie=UTF-8

KamasamaK commented 7 months ago

The PDF is on archive.org: https://web.archive.org/web/20211021051748/http://wwwimages.adobe.com/content/dam/acom/en/products/coldfusion/pdfs/cf2016/CF2016_Performance.pdf

zspitzer commented 7 months ago

We should be careful about citing performance stats, whilst it makes theoretical sense, it seems to be way overstated?

https://trycf.com/gist/7e7c04ef1614adf9bea423f67d0e007a/lucee5?theme=monokai

I see little difference in this little microtest with 50k appends? also seems the named parameters don't work in ACF 2023? (there's also acf uses dimensions, lucee has dimension)

pczarn2 commented 7 months ago

@KamasamaK Thanks for finding the reference!

@zspitzer without named params, this code works with ColdFusion engines:

a = arrayNew(1,false); // Implicit array notation a.append([]); // with values a.append( [ 'a','b', 3, 4, [], {complex: true}, queryNew("id,date") ] ); writedump(a);
pczarn2 commented 7 months ago

@pfreitag Pete, I added back the link with the archived version @KamasamaK found. Can you merge the change?

KamasamaK commented 7 months ago

@zspitzer

seems the named parameters don't work in ACF 2023? (there's also acf uses dimensions, lucee has dimension)

I am seeing that named parameters are working fine in ACF 2023. You are correct about the name difference with Lucee. Seems like the addition of an alias would be the way to go there.

@pczarn2

without named params, this code works with ColdFusion engines: ...

I am surprised that works in Lucee as well since Lucee has type as its second parameter. I wonder if it has a compatibility consideration where if it detects a Boolean value then it uses the signature with synchronized as the second parameter.

zspitzer commented 7 months ago

@KamasamaK https://luceeserver.atlassian.net/browse/LDEV-4822 :)

pfreitag commented 7 months ago

Merged the PR thanks @pczarn2!

Though I am now wondering if the performance is quite overstated based on what @zspitzer is saying but also on an article I found where @aliaspooryorik tested the feature, and didn't see much difference: https://coldfusion.adobe.com/2019/03/look-unsynchronised-arrays-cfml/

At the very least we should probably add an allegedly to the performance claims.

zspitzer commented 7 months ago

Aka, here's a useless rabbit hole, enjoy!

aliaspooryorik commented 7 months ago

Yeah - I did ask how they got that 90% performance increase but didn't hear back so none the wiser I'm afraid!