I thought I remembered that member functions (some...
# adobe
d
I thought I remembered that member functions (someArray.find("foo")), were slower than the old-school disembodied version (arrayFind(someArray, "foo")). I'm not seeing that in CF 2021. Has that performance difference really been ironed out? Does it only apply to some specific member functions or circumstances?
a
Not a direct answer, but I would really not look for performance gains in areas like this. And equally I'd not look for performance gains until I had an issue to address. Write the code that is easiest for the team to follow / maintain. Well-designed code is easier to improve once one finds one does need to identify and fix performance issues. PS: I had never myself heard that using methods over functions had a performance problem.
👍🏼 1
👍 1
d
Understood, just trying to clear out that cobwebbed "fact" I might be hanging onto...
💯 1
m
There's a weird tickle in the back of my brain that remembers a discussion on this years ago. I think we fixed the issue. But yeah, what Adam said. 🙂
👍 1
e
I have to say, AFC is about as robust as as a tank. You have to go out of your way to get any major negative performance hits for writing even really bad, code. You will; find far better performance gains to be had in understanding the tomcat configuration and how the JVM interacts with the CFML servlet than swapping around a few lines of code. As for your string vs string discussion, I believe it became moot past AFC 9 when they moved from JRUN to Tomcat.
c
I think there was some performance difference between the higher order member functions like
map()
,
each()
, and
reduce()
compared to
for in
loops (where loops were a bit faster). Not sure if that was what might have been fixed in 2021. The bigger issue was those member functions tended to swallow errors that occurred inside the closure, and it made troubleshooting a real pain.
3
👍 1
d
@cfvonner Rings a bell, thanks. Any idea if the error vanishment thing has been addressed?
a
Pretty sure that was only a fairly short-lived issue.