Which operation would cost more?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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/)
 
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
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/)
 
Back
Top