Christof Donat wrote:
> Simulate XMLSerializer globally and use it always - change the serialization 
> function on first call to distinguish between IE and others.
[snip]
> I admit, that the two suggestions might not be to easy to understand. I like 
> to play with functions as values :-)
> 
> At least the first one provides a more general solution by simulating 
> XMLSerializer and both of them are faster after the first call. That might be 
> a criterium if you work with large Datasets. If performance is imortant to 
> you, you might also consider to replace the calls to each() with for-loops.

Christof, thanks for your ideas.

The thing is, the main use case for a toXML() call is to send
XML data via an ajax request.

The duration of the request greatly overshadows any optimisation
that could be applied to toXML.

Also, I don't think it is a good idea to attempt to implement an
XMLSerializer object for the sake of it, especially when the full
interface isn't being implemented - it could have further reaching
effects than you expect.

As a rule I live by the KISS principle, and never optimise code unless
it becomes a bottleneck, and then only do so under profiling conditions.

Regards
- Mark Gibson

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to