Tips and tools for finding out why serialized files are so big

[VS.NET 2005 Beta 2]
Hi,
I was wondering if anyone knows of any tools that can help determine why (binary) serialized files are bigger than expected? Maybe something that graphs the serialized objects in the file?
If not, does anyone have any tips for finding out? I'm sure I can work it out with tracing but it would be good to hear if anyone knows any shortcuts!Smile
Cheers,
G.
[471 byte] By [GraemeFoster] at [2008-2-16]
# 1
the algo is proprietary so no not really.

why do you think the serialized objects are larger than they should be? how are you serializing?

also, you can write custom serialization routines (look at GetObjectData methods)

stand__sure at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 2

Since we do not have access to the binary format, there is no easy way to detemine what data is in the file. It sure would be nice if we at least had a dump utility for the binary format so that we could peer inside the file (I'm not sure why Microsoft feels the need to keep the format so closely guarded). If you are lucky and only using the functionality provided by one of the human readable formats, you might be able to output your data in one of those formats and look at the contents but In my experience, there aren't two serialization models compatible enough to do so.

The only option I can think of other than tracing is to write your own formatter so that the data is readable and/or dumpable.

- Ray

RayManning at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 3
Hmm, I was thinking something along the lines of a custom formatter, but wouldn't that work for any classes as long as the assemblies were available at the time?
That's why I thought I'd ask to see if there was a tool implementing such a formatter for diagnostic purposes :)
We use a mixture of custom and "built-in" serialization and the culprit is usually a missing [NonSerialzed] attribute. But they're a pain to find. A graph of what-references-what (like that tool that shows reachable objects whose name I forget) would be just the ticket.
Ah well... Thanks anyway! :(
GraemeFoster at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 4

you can always serialize out to xml when looking for these... the soap formatter is useful somethimes (although verbose)...

stand__sure at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 6
Perhaps I've missed a conneciton between the BinarySerializer and one of these other server protocols but I don't see the binary format listed on the referenced page.

- Ray

RayManning at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 7
under .NET Remoting TcpChannel Protocol
http://members.microsoft.com/consent/info/protocol_pages/portal__net_remoting_tcpchannel_wire_format_protocol.htm

I am glad to see this licensing available, but do wonder under what circumstances would a private consultant/developer benefit from obtaining such a license (e.g. if I write a simple Tcp Client/Server system for someone to use on an intranet, do I need to obtain a license or does my VS license cover this use?)

stand__sure at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 8

That's a good question but glancing at the license agreement, I'd think a lawyer would have to answer that one.

I doubt anyone would sign this license just so they can peek inside the binary format to see what they serialized. At least I know I won't.

A converter from the binary format to human readable/xml would still be a nice tool to have.

- Ray

RayManning at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 9
RayManning wrote:
A converter from the binary format to human readable/xml would still be a nice tool to have.

Definately!
Thanks for the answers - even if they're not the ones I wanted to hear... Sad
G.
GraemeFoster at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...

.NET Development

Site Classified