By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,742 Members | 1,227 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,742 IT Pros & Developers. It's quick & easy.

Which operation would cost more?

P: n/a
Consider the following:

I have a socket server that converts the incoming data to astring. Each reception of data is to be stored in a new row ofa dataset.

Is it cheaper (in the sense of system resources) to storeeverything into a single string, pass the string back to mymain(), perform string manipulation, and add the data to thedataset accordingly. -OR- pass the dataset obj to my TCPServer,add rows of data to the dataset as data comes in, and then passthe modified dataset back to main. The concactanated stringsfrom the first method would never exceed much more than a couplehundred characters. The dataset would be dynamic and couldreach upwards of 10K characters (plus all the overhead in adataset).
User submitted from AEWNET (http://www.aewnet.com/)
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
To begin with, in order to pass a DataSet over the wire as a stream of bytes
over tcp, you would have to use a custom serializer or a serializer
surrogate class such as Ravinder Vuppula's DataSetSurrogate, otherwise
converting the class instance to bytes would involve a high amount of XML,
since that's the way the .NET 1.1 DataSet describes itself to the
serialization framework.

So my take is that it would be better to handle the row-by row data as a
string. Even better is if you dont' convert it to a string at all, since
most string - related operations are not very performant from a CLR point of
view.
--Peter
<@aew_nospam.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Consider the following:

I have a socket server that converts the incoming data to a string. Each
reception of data is to be stored in a new row of a dataset.

Is it cheaper (in the sense of system resources) to store everything into a
single string, pass the string back to my main(), perform string
manipulation, and add the data to the dataset accordingly. -OR- pass the
dataset obj to my TCPServer, add rows of data to the dataset as data comes
in, and then pass the modified dataset back to main. The concactanated
strings from the first method would never exceed much more than a couple
hundred characters. The dataset would be dynamic and could reach upwards of
10K characters (plus all the overhead in a dataset).
User submitted from AEWNET (http://www.aewnet.com/)
Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.