序列化的BinaryFormatter *性能*问题 [英] Serialization with BinaryFormatter *PERFORMANCE* issues

查看:416
本文介绍了序列化的BinaryFormatter *性能*问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景:

我卡与被序列化到文件的某些60MBs(并会随着时间的推移)大的对象图。问题不在于文件大小,但写作和阅读时间,即去长达4分钟的一些机器。

I'm stuck with LARGE object graph that gets serialized into some 60MBs of file (and will grow over time). Problem isn't file size but writing and reading times, that go up to 4 minutes on some machines.

简介:

由于这种重presents某种内存数据库的,我可以延迟加载一些吧。

Since this represents some kind of in-memory database, I can delay-load some of it.

喧:

如何测量特定对象块的加载时间?难道我登录的构造函数调用,并从那里走?任何更好的主意吗?

How to measure loading time of specific object chunks? Do I log constructor invocations and go from there? Any better idea?

编辑:

我宁愿不谈替代序列化,有很多关于这个问题的帖子,我宁愿调查为什么会这么慢,什么对象图的一部分,是很好的候选人,切除和延迟加载。

I would rather not talk about alternatives to serializing, there are lots of posts on that subject, I would rather investigate why is it so slow and what part of the object graph is the good candidate for 'excision' and delay load.

推荐答案

您可以尝试的 protobuf.NET 的已被报道为更快。

You may try protobuf.NET which has been reported to be faster.

这篇关于序列化的BinaryFormatter *性能*问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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