473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Serialization Performance (again)

Joe
Hi again,

I used a profiler like recommended and found that the majority of time is
spent on WriteArrayMember. I have around 15 classes that inherit from
CollectionBase. ObjectWriter.GetType is taking .3468 seconds and
System.GetType is taking .4340 seconds.

I would expect GetType to return much quick.

I was reading somewhere that overriding GetHashCode() can help.
Is there a way to specify the type that is contained within the
CollectionBase.InnerList?

Thanks for any help,
Joe
Nov 20 '05 #1
4 1400
There's no way to change the type used by CollectionBase, but you can always
write a collection from scratch to do it.

You might want to take a look at CodeSmith: http://www.codesmithtools.com/

I use it for generating custom collections all the time.

Pete
"Joe" <jb*******@noemail.noemail> wrote in message
news:Om**************@TK2MSFTNGP10.phx.gbl...
Hi again,

I used a profiler like recommended and found that the majority of time is
spent on WriteArrayMember. I have around 15 classes that inherit from
CollectionBase. ObjectWriter.GetType is taking .3468 seconds and
System.GetType is taking .4340 seconds.

I would expect GetType to return much quick.

I was reading somewhere that overriding GetHashCode() can help.
Is there a way to specify the type that is contained within the
CollectionBase.InnerList?

Thanks for any help,
Joe

Nov 20 '05 #2
Hi Joe,

Thanks for Pete's reply. I just wanted to check how things are going and
whether or not Pete's suggestin is helpful for you.

If there is any question, please feel free to join the community and we are
here to support you at your convenience. Thanks again and have a nice day.

Best Regards,

Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Nov 23 '05 #3
Joe
Hi Terry,

Thanks Pete for you reply!

I can create my own collection base class if needed. I guess my main
questions are will it help and why is the performance so bad? If I have to
create a collection class for each of my collections than it defeats the
purpose of having a collection base class.

If I understand the way serialization works, GetType() is called on each
object in the array to find out what object type it is. Once it knows this
it serializes that object.

The strange thing is the performance is excellent on a Windows 2003 server
(regardless of the edition) but any other OS like Windows 2k or Windows XP
the performance is very, very bad. I've tried 4 different servers and 4
different XP machines and 2 Windows 2k machine and the results are pretty
much the same.
To give you an idea on the difference a server OS take < 2 seconds to
serialize and object and the XP and 2000 machines take ~2 minutes.
These are not super servers. In fact one of them is an identical hardware
match to one of the XP machines.

In any case I'm going to test out a custom collection base and see what
happens.

Thanks again,
Joe

""TerryFei"" <v-******@online.microsoft.com> wrote in message
news:ZP**************@TK2MSFTNGXA02.phx.gbl...
Hi Joe,

Thanks for Pete's reply. I just wanted to check how things are going and
whether or not Pete's suggestin is helpful for you.

If there is any question, please feel free to join the community and we
are
here to support you at your convenience. Thanks again and have a nice day.

Best Regards,

Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 23 '05 #4
Hi Joe,
Thanks for your feedback!

In this scenario, I hope you could send a simplified sample to us so that
we can test performance on our machine, which will help us get closer to
find bottleneck. So I appreciate your time in performing them.

If you have any further information related to this problem, please feel
free to post here.
Thanks very much and looking forward to hearing from you.

Best Regards,

Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Wayne Wengert | last post by:
This is my first attempt to re-write an old VB6 application that exported a CSV file to a .NET application that exports an XML file with the equivelent data. I have limited understanding of OO...
11
by: ajou_king | last post by:
I was running some tests on my Win32 1GHZ processor to see how long it would take to transmit objects numerous times via TCP/IP using C# ..NET Remoting vs the C++ trustworthy method of binary...
7
by: schoenfeld1 | last post by:
I've implemented IPC between two applications using named pipes and binary serialization, but have noticed that the binary formatter is rather slow. It seems that the binary formatter reflects...
27
by: Codemonkey | last post by:
Heya All, Sorry, but I think it's about time for a monkey-ramble. I've just had enough of trying to serialize even simple objects with VB. A simple task you may think - stick the...
7
by: Joe | last post by:
I've tracked the performance issue down to a single class. This class derives from CollectionBase and stores a basic value type such as string, int, double, etc... I also store the type itself...
3
by: _DD | last post by:
I had one experimented with binary serialization of an ArrayList of structs (each struct mostly contains strings). Strangely enough, it did not run as fast as custom XML storage (latter was...
0
by: ronnotel | last post by:
I have integrated APIs from a third party into my framework. The third party is essentially a .Net wrapper on top of an existing set of C++ classes and structs. I want to pass-around objects in...
2
by: =?ISO-8859-1?Q?=22Andr=E9s_G=2E_Aragoneses_=5B_kno | last post by:
I am developing a Windows Service that is resident on the machine. The program needs to synchronize certain object list in memory (an object typed as List<Foo>) with disc, serializing and...
11
by: William | last post by:
I'm looking for an example that would show how to serialize a c++ object at it's simplest w/o using any other api's. I have a class that I want to serialize and then pass to my obj-c class so I can...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.