XML解析太慢了! [英] XML Parsing too slow!

查看:286
本文介绍了XML解析太慢了!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个java应用程序,用于使用XML与Web应用程序进行通信。部署之后,我发现解析Web应用程序生成的XML需要很长时间。

I wrote a java app to communicate with a web application using XML. After deployment, I found out it takes too long to parse the XML generated by the web application.

例如,登录需要大约2分钟;登录信息包含在网址中。 Web应用程序执行其处理并响应Java应用程序,无论登录是否使用返回的XML成功。

For example, it takes about 2 minutes to login; the login information is included in the url. The web application does its processing and responds to the Java app whether the login was successful using XML returned.

我使用标准的java DOM解析。

I used the standard java DOM parsing.

我有没有办法优化这个过程,以便活动更快?

Is there a way I can optimize this process so that activities can be faster?

推荐答案

使用标准XML解析器时,应该在大约一毫秒内解析一条短消息。使用自定义解析器,您可以将其减少到大约20微秒。任何比这更长的时间都不在XML解析中

Using a standard XML parser a short message should be parsed in about one milli-second. Using a custom parser you can cut this to about 20 micro-seconds. Any time longer than this is not in the XML parsing

这篇关于XML解析太慢了!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆