473,395 Members | 2,796 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,395 software developers and data experts.

BinaryFormatter slower than DataTable.Save!?

Hi All,

I was saving a DataTable out to disk using DataTable.Save(). Later
loading it with DataTable.Load().

In order to get greater performance I replaced these two calls with
BinaryFormatter.Serialize() and BindaryFormatter.DeSerialize. Both of
these used a FileStream to work with files. Strangely this binary
formatting is about 3x slower than the DataTable's native Save()
method.

Anyone got any thoughts on this? I would have thought Binary
Formatting to be faster than Xml Formatting. Any further suggestions
for performance gains?

Stewart

Jan 18 '06 #1
4 1924
Where I've referred to DataTable Save() and Load(), I meant to say
WriteXml() and ReadXml().

Jan 18 '06 #2
This is a known behavior in 1.1. Binary serialization of
datasets/datatables is realy slow because internally the dataset object
implements the ISerializable interface which first serializes the data
into xml (using diffgram) and then to the binary format. No
optimaization and compression is done.

This has been fixed in 2.0 where datasets and datatables have native
support for binary serialization.

Read more here..
http://msdn.microsoft.com/msdnmag/is...0/CuttingEdge/

- NuTcAsE

Jan 18 '06 #3
Thanks, however this is in 2.0 that I'm experiencing the issue.

Jan 18 '06 #4
Even after setting the data set / data table to use binary
serialization by setting the SerialziationFormat?

Jan 19 '06 #5

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

Similar topics

5
by: aladdinm1 | last post by:
Hi All, I have an annoying trouble with binary serialization. I have a windows forms application which works like a server and keeps sending data to its clients. The data is serialized before...
0
by: Emerson | last post by:
The following assumes a System.Windows.Forms.DataGrid with a System.Data.DataTable set as the DataSource. I'm programming in C# Here's my scenario I click in a cell on a DataGrid. I enter some...
3
by: Joshua Moore | last post by:
I have a webservice that serializes a ton of variables and other good stuff to a txt file using SoapFormatter (IFormatter), and when I try to deserialize it using the binary formatter, i get the...
1
by: 2G | last post by:
Hi, When I serialize a object using the binaryformatter and save it to a file, the file contains some parts of unreadable junk. Should I do some encoding on the bytearray or something before...
2
by: Doug Lind | last post by:
Hi all, I have seen a number of posts re: the BinaryFormatter version incompatibility but nothing on how to recover from it. In my case, I want the exception to trigger an alternate behaviour...
4
by: windsurfing_stew | last post by:
Hi All, I was saving a DataTable out to disk using DataTable.Save(). Later loading it with DataTable.Load(). In order to get greater performance I replaced these two calls with...
9
by: Anil Gupte | last post by:
After reading a tutorial and fiddling, I finally got this to work. I can now put two tables created with a DataTable class into a DataRelation. Phew! And it works! Dim tblSliceInfo As New...
0
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
Hi, I have a webservice returning a serialized class as
2
by: chike_oji | last post by:
Please can someone help me. I am writing a web application, that allows for the upload of an excel sheet into the database. I have an upload button and a save button. The upload button allows...
1
by: Tarscher | last post by:
Hi all, i want to save my application to a file with a BinaryFormatter . I have some questions how the BinaryFormatter will work when the I update my application. How can I make sure that I can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.