Flash 中的 XML 与数组
在 Flash 中操作数据时,哪种数据格式在搜索和操作方面提供更快的速度,XML 还是嵌套关联数组?这意味着我目前将字符串数据发送到 Flash 客户端(我不想加载 XML 文件),但我不确定将数据格式化为 XML 文件或嵌套关联数组是否会在性能方面更好。数据大小怎么样?以 XML 格式设置数据是否会导致数据大小变小或变大(这最终会影响 Flash 客户端文件的大小)?
In manipulating data in Flash, which data format gives faster speeds in terms of searching and manipulation, XML or nested associative arrays? Meaning I currently send data in strings into the Flash client (I don't want to load an XML file) but I'm not sure if formatting the data into an XML file or into nested associative arrays is better in terms of performance. What about data size? Does formatting the data in XML result in smaller or larger data size (which ultimately contributes to the size of the flash client file)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
自己回答这个问题的最佳方法是执行基准测试。循环对数据执行一些操作并记录开始和结束时间。我有一种感觉,您会发现数组的性能会更好,因为需要先解析 XML,然后才能使用其中的数据。但你绝对应该做基准测试来验证。
The best way to answer this question for yourself is to perform a benchmark. Perform some operations on your data in a loop and record the begin and end times. I have the feeling you'll find that arrays will perform better because XML needs to be parsed before the data inside can be used. But you should definitely do the benchmark to verify.
这取决于你的数据。如果你的数据很大,xml会更快,但如果你的数据很小,你可以使用数组。
That would depend on your data. If your data is very huge, xml would be faster, but if your data is small, you can use array.