473,804 Members | 2,985 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Serialization Performance (again)

Joe
Hi again,

I used a profiler like recommended and found that the majority of time is
spent on WriteArrayMembe r. I have around 15 classes that inherit from
CollectionBase. ObjectWriter.Ge tType 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 1417
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*******@noem ail.noemail> wrote in message
news:Om******** ******@TK2MSFTN GP10.phx.gbl...
Hi again,

I used a profiler like recommended and found that the majority of time is
spent on WriteArrayMembe r. I have around 15 classes that inherit from
CollectionBase. ObjectWriter.Ge tType 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.m icrosoft.com> wrote in message
news:ZP******** ******@TK2MSFTN GXA02.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
1633
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 programming concepts (am trying to learn) and XML serialization is all new ground for me. Anyway, here is what I am trying to accomplish: Goal ---- We sponsor competitions in ehich various teams compete. An "event" is made up of a set of "shows"....
11
11964
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 streams. I ran the test for 50K, 100K, 500K iterations, where each iteration consists of sending an object from a client process to a server process, and the server process sends back an ack. Here are the results: .NET Remoting C++...
7
9561
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 the entire type everytime it is invoked to serialize/deserialize an object of that type. Is there a way to prepare the binary formatter with a pre-defined type, such that it only reflects once but can be re-used to serialize/deserialize objects...
27
1950
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 <Serialized()> attribute on the class and away you go. As Homer would say - "D'Oh" The root of my problem lies in the way VB implements Events and the fact that you can't apply the <NonSerialized> attribute to the little rascals.
7
1797
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 which you can see I'm using when calling AddValue. I implemented ISerializable and GeteObjectData. Here's what I tried: for (int i = 0; i < this.Count; i++) info.AddValue("item" + i.ToString(), this, typeof(type) );
3
8196
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 nothing fancy, but did not use normal serialization). I was not pressed to get runtime optimized at the time, so I just went with XML. The situation has shifted, and I have to figure out the *fastest possible* way to save and reload that ArrayList. ...
0
3038
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 these native structures as much as possible - that is I don't want to fool around with object serialization/deserialization. Data rates approach several hundred thousand objects per second, hence I simply can't pay the performance penalty this...
2
1779
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 deserializing XML. The first simplest technique I have used ATM is the following: - At program start, if the XML file exists, deserialize it and create an object with its content. - Every time the list changes (an element is added or remove), I...
11
3700
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 send it over the wire. I'm just looking for how to serialize it, then pack it back up on the other end. Any help much appreciated.
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10569
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10325
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10315
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10075
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.