donglu1472 2011-07-22 18:28
浏览 45
已采纳

压缩的XML文件是否会影响性能和内存? 有哪些更好的XML技巧?

My question is if there is an easy way to compress an XML file. I read about EXI, gzip and similar, but I didn't understand how to do it, or if my question is possible.

What I am trying to achieve is to reduce the size of my XML file that I use with SimpleXML. Is that possible and if it is, will this have an impact on speed/performance/memory ?

Also, a large XML file is considered large based on the size or the number of elements?

Are there any tips that you should follow for a "better" XML?

  • 写回答

3条回答 默认 最新

  • douhei8633 2011-07-22 18:48
    关注

    The best way I can think is just to remove as much unnecessary data as possible. i.e. don't make it formatted for human readability. That would include many unnecessary spaces/tabs/newlines. Use self closing tags whenever possible and just reduce the content down to the bare minimum that still meets XML specs. I'm sure there are compressors out there that do this. This kind of "compression" does not require decompression before parsing, but in turn may not save you much space.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败