Interesting.. Returning a native HashMap from Java to CFMX
doest allow you to use #structName.key#, you have to use

#structName["key"]# or #structName.get("key")#

Looks like CFMX is doing some backward Compatible Casting to something!

> <cfloop list="..." ...>
> That's much faster than using listGetAt()

Nah.. we have to dump data at multiple positions. MetaData involved
for Multi-Country, Muti-Language processing as well.

> Right, but you don't need to do the conversions from list to achieve
> this - you can iterate over the lists natively in Java

HashMap takes only objects, i think there is casting issue with using Lists
and Iterator... u have to join the Iterator to List as well.

My thoughts are .. this would be much faster/readable/4 lines of code.

HashMap hm = new HashMap();
String keys[] = rObj.getProperty(propKey).split("~");
String values[] = rObj.getProperty(propValue).split("~");
for(int i=0;i < keys.length;i++){
 hm.put(keys[i],values[i]);
}
return hm;

> - don't waste time and energy optimizing something that really isn't a
> bottleneck (you didn't answer my questions about load testing and
> bottleneck analysis!).

Java has HashMap,Hashtable,HashSet,ArrayList,LinkList,Vectors...etc
Each of the above Handles a SPECIFIC TYPE of Operation/Data Structure well.

"O'Rielly's Java Performance Tuning book discuses when and where to use
what type of collection Objects"

CFMX does a good job at hiding the details but sometimes.. when your
enviroment/Architecture is dependent on these factors... you are kinda
forced to go Native.

If i was using SQL-Server and CFMX.. i wouldnt bother converting any Data
Structures,
cause we basically deal with resultSets.

Now.. i am curious.. why you cant use #structName.key# with a Java HashMap.
Any Ideas?

Thanks,
Joe Eugene


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Sean A Corfield
> Sent: Monday, June 23, 2003 2:03 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [CFCDev] Java Structs Vs CFMX Structs
>
>
> On Sunday, Jun 22, 2003, at 22:21 US/Pacific, Joe Eugene wrote:
> > CFMX using list directly
> > Alot of ListGetAt(list, position) <-- Idea is to avoid calling
> > ListGetAt()
> > 20 - 50 times within any given page output.
>
> <cfloop list="..." ...>
>
> That's much faster than using listGetAt() - assuming you wish to simply
> iterate through the list in order.
>
> >> You could have a JavaBean that presents an array-like interface but
> >> manipulates the RBO lists directly and another JavaBean that presents
> >> a
> >> struct-like interface but manipulates the RBO lists directly
> > Yes, the above is exactly what i am trying to do.
>
> Right, but you don't need to do the conversions from list to achieve
> this - you can iterate over the lists natively in Java.
>
> > MAN!.. i am still curious why CFMX HashMap/Structs implementation is
> > slower.
>
> CFMX has a *lot* of other stuff going on, e.g., case insensitive keys,
> multiple scope lookup etc etc. Again, the issue isn't really whether
> one is slower than the other but whether the performance is good enough
> - don't waste time and energy optimizing something that really isn't a
> bottleneck (you didn't answer my questions about load testing and
> bottleneck analysis!).
>
> > Only Problem.. Other CF developers in the group..dont understand
> > Java/Alot
> > of the
> > data structure conversions etc.. so i am forced to limit Native Java
> > usage.
>
> So, write the JavaBean Adapter / Iterator and then wrap that in a
> simple CFMX interface they are comfortable using - again, without
> actually converting the underlying data structure.
>
> > Nice Ride :)
>
> Innit? :)
>
> Sean A Corfield -- http://www.corfield.org/blog/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
> in the message of the email.
>
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.com).

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

Reply via email to