> -----Original Message-----
> From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 04, 2005 12:43 PM
> To: CF-Talk
> Subject: RE: [SOT] Better WDDX JavaScript serializer/deserializer
> functions?
> 
> The reason the wddx.js stuff is so slow is because it's parsing the XML as
> a
> string. The larger the string the slow it is. It was written this way for
> maximum browser compatibility.

Actually... no.  ;^)

It was written that way because at the time there was no other way to write
it - the DOM hadn't yet been published.  Remember that the JS WDDX library
included in the official SDK was written in what... 1998?  1999?

> Since you're relying on AJAX (which would utilize an XML object within the
> browser,) you might be able to get a speed increase by creating a new WDDX
> library that uses the XML object to natively parse the XML document and
> then
> convert that into data.

Did that... here's the link.  ;^)

http://www.depressedpress.com/Content/Development/JavaScript/Extensions/DP_W
DDX/Index.cfm

I only did DOM processing for deserialization (serialization seems just fine
as string concatenations and building a DOM object by hand is tedious as
all-get-out).

This hasn't gone through a thorough battery of tests yet but so far it seems
to do the trick. 

I've not done any speed tests compared to the official parser but my guess
is it should be faster most cases (I also use Regular Expressions and other
"modern" techniques not available when the official parser was written).

I think in some browsers it may be VERY MUCH faster - but that depends on
the browser's implementation of the DOM.  Some browsers (FireFox for
example) are quite speedy with DOM operations while some (IE) aren't
optimized in that direction.

I'd love it if somebody wanted to run some "independent" tests of the two.

Jim Davis




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:220099
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to