ActionScript - XML/E4X 很慢?

发布于 2024-10-01 21:01:32 字数 125 浏览 5 评论 0原文

我一直在读到 XML/E4X 对于 AVM2 / ActionScript 3 来说非常慢。

当向应用程序提供 XML 数据时,将 XML 对象解析为要调用的对象数组而不是使用 E4X 总是更好的主意股票 XML 数据?

i've been reading that XML/E4X is very slow with AVM2 / ActionScript 3.

when supplying an application with XML data, is it always generally a better idea to parse the XML object into an array of objects to call rather than using E4X with the stock XML data?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

朦胧时间 2024-10-08 21:01:32

除了性能问题之外,将应用程序与数据源解耦也是一个好主意。

比方说,您希望将来使用 JSON...将 XML 数据传递给一个 Object 并从该 Object 操作您的数据,而不是直接访问 XML 会更灵活。

Aside from the performance issue, it would be a good idea to decouple your application from the data source.

Let's say , for example, that you'd like to use JSON in the future... It'd be more flexible to pass the XML data to an Object and manipulate your data from that Object , rather than accessing the XML directly.

烟花易冷人易散 2024-10-08 21:01:32

我对此没有太多经验,但我一直听说 fp 中的 e4x 非常快,但我会将所有内容转移到对象以在您的应用程序中实际使用。这样做的优点是可以让编译器检查您的属性和类型。您可能仍然会使用 e4x 将 xml 转换为对象,但恕我直言,将它们用作对象应该更容易、更快。

I don't have a lot of experience with it but I have always heard that e4x in the fp was pretty fast, but I would transfer everything over to objects to actually use in your application. This has the advantage of letting your compiler check your properties and types. You would still probably use e4x to translate your xml into objects, but using them as objects should be easier and faster IMHO.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文