实体框架数据压缩
我有一个 WCF Windows 服务,它通过压缩数据集向 250 多个 PDA 提供数据,并且希望重新开发该服务和移动应用程序以使用 Entity Framework 4.x 模型。
为了在 PDA 上发送/接收数据时保持可接受的性能,我需要保持数据大小尽可能小,并且想知道是否可以从 WCF windows 服务压缩 IEnumerable?
根据之前使用数据集的经验,我获得了 80%+/- 的压缩率,甚至在 PDA 上解压缩数据也获得了 50% 的总体性能提升,因此保持类似的性能水平至关重要。
编辑: 我可以使用二进制序列化器然后压缩流吗? 如图所示
I have a WCF Windows service that provides data to 250+ PDAs via compressed datasets and was looking to redevelop both the service and the mobile application to use Entity Framework 4.x models.
In order to keep performance acceptable when sending/receiving data on the PDA I need to keep the data size as small as possible and was wondering if its possible to compress a IEnumerable from the WCF windows service?
From previous experience with the datasets I got a 80%+/- compression rate and even decompressing the data on the PDA achieved an overal 50% performance importment so retaining similar levels of performance is critical.
EDIT:
Could I use a binary serializer and then compress the stream? As shown here
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您无法使用内置的 IIS GZip 功能,那么您始终可以手动执行此操作,例如
,然后只需让您的 WCF 方法返回一个字节数组,然后您就可以解压缩该字节数组。在客户端反序列化。
上面的代码是一个扩展方法,因此您基本上只需调用
return myList.compress()
即可。If you can't use the built in IIS GZip capabilities then you can always do it manually e.g.
Then just have your WCF method return a byte array which you can then decompress & deserialize on the client side.
The above code is an extension method so you can basically just call
return myList.Compress()
.