473,772 Members | 2,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Increasing time with increasing size of string

I have been working on a way to take a datatable from a dataset and
transform it into a Geography Markup Language(GML) stream so it can be
loaded into another component. The problem i'm finding is that the building
of the string to transform it into a stream is taking longer and longer as
you add more data to the string ( as you can see from the printout below.

Any suggestions for reducing the time? Should i be writing the GML to the
memory stream right away rather than trying to build one big string and
write that to memory stream? This data table that could be coming in could
contain thousands and thousands of rows.

----------------------------------------------------------------------------
-------------------
2007-07-20 11:50:17 AM : 100
2007-07-20 11:50:20 AM : 200
2007-07-20 11:50:23 AM : 300
2007-07-20 11:50:27 AM : 400
2007-07-20 11:50:32 AM : 500
2007-07-20 11:50:37 AM : 600
2007-07-20 11:50:43 AM : 700
2007-07-20 11:50:50 AM : 800
2007-07-20 11:50:59 AM : 900
2007-07-20 11:51:08 AM : 1000
2007-07-20 11:51:17 AM : 1100
2007-07-20 11:51:27 AM : 1200
2007-07-20 11:51:39 AM : 1300
-----------------------------------------------CODE
BELOW---------------------------------------------
Public Sub LoadDataTable(B yVal dt As DataTable, ByVal xcol As String,
ByVal ycol As String, ByVal srs As String)
Dim dr As DataRow
Dim dc As DataColumn
Dim GMLString As String
Dim featureID As Integer = 1

GMLString = SetGMLHeader()

For Each dr In dt.Rows
GMLString &= " <gml:featureMem ber>" & vbCrLf
GMLString &= " <SML:NavPoint fid=""NavPoint. " & featureID &
""">" & vbCrLf
GMLString &= ConvertRecord(d r, dt.Columns, xcol, ycol, srs)
GMLString &= " </SML:NavPoint>" & vbCrLf
GMLString &= " </gml:featureMemb er>" & vbCrLf
featureID += 1
If featureID Mod 100 = 0 Then
Console.WriteLi ne(Date.Now & " : " & featureID)
End If
Next

GMLString &= SetGMLFooter()

Dim memoryWriter As New StreamWriter(mG MLStream)
memoryWriter.Wr ite(GMLString)
memoryWriter.Fl ush()
'Console.WriteL ine(GMLString)
End Sub

Private Function SetGMLHeader() As String
Dim returnString As String

returnString = "<?xml version=""1.0"" encoding=""UTF-8""?>" & vbCrLf
& vbCrLf
returnString &= "<SML:FeatureCo llection " & vbCrLf
returnString &= " xmlns=""http://www.spatialmapp ing.com/gml""" &
vbCrLf
returnString &= " xmlns:gml=""htt p://www.opengis.net/gml""" & vbCrLf
returnString &= " xmlns:SML=""htt p://www.spatialmapp ing.com/gml""" &
vbCrLf
returnString &= "
xmlns:xsi=""htt p://www.w3.org/2001/XMLSchema-instance"">" & vbCrLf & vbCrLf
& vbCrLf

Return returnString

End Function

Private Function SetGMLFooter() As String
Dim returnString As String

returnString = "</SML:FeatureColl ection" & vbCrLf
Return returnString
End Function

Private Function ConvertRecord(B yVal geoRecord As DataRow, ByVal
geoColumns As DataColumnColle ction, ByVal xcol As String, ByVal ycol As
String, ByVal srs As String) As String
Dim returnString As String
For Each dc As DataColumn In geoColumns
If dc.ColumnName <xcol And dc.ColumnName <ycol Then
returnString &= " <SML:" & dc.ColumnName.T oUpper &
">"
returnString &= geoRecord.Item( dc.ColumnName)
returnString &= "</SML:" & dc.ColumnName.T oUpper & ">" &
vbCrLf
End If
Next
returnString &= " <SML:GEOMETRY >" & vbCrLf
returnString &= " <gml:Point srsName=""" & srs & """>"
& vbCrLf
returnString &= " <gml:coordinate s>" &
geoRecord.Item( xcol) & "," & geoRecord.Item( ycol) & "</gml:coordinates >" &
vbCrLf
returnString &= " </gml:Point>" & vbCrLf
returnString &= " </SML:GEOMETRY>" & vbCrLf

Return returnString
End Function
Jul 20 '07 #1
5 1302
Solved it and my solution was to write to the memorystream after each
iteration.
-----------------------------CODE BELOW----------------------------------
Public Sub LoadDataTable(B yVal dt As DataTable, ByVal xcol As String,
ByVal ycol As String, ByVal srs As String)
Dim dr As DataRow
Dim dc As DataColumn
Dim GMLString As String
Dim featureID As Integer = 1

GMLString = SetGMLHeader()
Dim memoryWriter As New StreamWriter(mG MLStream)
memoryWriter.Wr ite(GMLString)
memoryWriter.Fl ush()

For Each dr In dt.Rows
GMLString = " <gml:featureMem ber>" & vbCrLf
GMLString &= " <SML:NavPoint fid=""NavPoint. " & featureID &
""">" & vbCrLf
GMLString &= ConvertRecord(d r, dt.Columns, xcol, ycol, srs)
GMLString &= " </SML:NavPoint>" & vbCrLf
GMLString &= " </gml:featureMemb er>" & vbCrLf
featureID += 1
memoryWriter.Wr ite(GMLString)
memoryWriter.Fl ush()
If featureID Mod 100 = 0 Then
Console.WriteLi ne(Date.Now & " : " & featureID)
End If
Next

GMLString &= SetGMLFooter()

memoryWriter.Wr ite(GMLString)
memoryWriter.Fl ush()
'Console.WriteL ine(GMLString)
End Sub
----------------------------------------------OUTPUT
BELOW----------------------------
2007-07-20 12:08:38 PM : 100
2007-07-20 12:08:38 PM : 200
2007-07-20 12:08:38 PM : 300
2007-07-20 12:08:38 PM : 400
2007-07-20 12:08:38 PM : 500
2007-07-20 12:08:38 PM : 600
2007-07-20 12:08:38 PM : 700
2007-07-20 12:08:38 PM : 800
2007-07-20 12:08:38 PM : 900
2007-07-20 12:08:38 PM : 1000
2007-07-20 12:08:38 PM : 1100
2007-07-20 12:08:39 PM : 1200
2007-07-20 12:08:39 PM : 1300
2007-07-20 12:08:39 PM : 1400
2007-07-20 12:08:39 PM : 1500
2007-07-20 12:08:39 PM : 1600
2007-07-20 12:08:39 PM : 1700
2007-07-20 12:08:39 PM : 1800
2007-07-20 12:08:39 PM : 1900
2007-07-20 12:08:39 PM : 2000
2007-07-20 12:08:39 PM : 2100
2007-07-20 12:08:39 PM : 2200
2007-07-20 12:08:39 PM : 2300
2007-07-20 12:08:39 PM : 2400
2007-07-20 12:08:40 PM : 2500
2007-07-20 12:08:40 PM : 2600
2007-07-20 12:08:40 PM : 2700
2007-07-20 12:08:40 PM : 2800
2007-07-20 12:08:40 PM : 2900
2007-07-20 12:08:40 PM : 3000
2007-07-20 12:08:40 PM : 3100
2007-07-20 12:08:40 PM : 3200
2007-07-20 12:08:40 PM : 3300
2007-07-20 12:08:40 PM : 3400
2007-07-20 12:08:40 PM : 3500
2007-07-20 12:08:40 PM : 3600
2007-07-20 12:08:40 PM : 3700

"Gary Townsend" <ga***@spatialm apping.comwrote in message
news:dJ7oi.5944 3$xk5.14807@edt nps82...
I have been working on a way to take a datatable from a dataset and
transform it into a Geography Markup Language(GML) stream so it can be
loaded into another component. The problem i'm finding is that the
building
of the string to transform it into a stream is taking longer and longer as
you add more data to the string ( as you can see from the printout below.

Any suggestions for reducing the time? Should i be writing the GML to the
memory stream right away rather than trying to build one big string and
write that to memory stream? This data table that could be coming in could
contain thousands and thousands of rows.

--------------------------------------------------------------------------
--
-------------------
2007-07-20 11:50:17 AM : 100
2007-07-20 11:50:20 AM : 200
2007-07-20 11:50:23 AM : 300
2007-07-20 11:50:27 AM : 400
2007-07-20 11:50:32 AM : 500
2007-07-20 11:50:37 AM : 600
2007-07-20 11:50:43 AM : 700
2007-07-20 11:50:50 AM : 800
2007-07-20 11:50:59 AM : 900
2007-07-20 11:51:08 AM : 1000
2007-07-20 11:51:17 AM : 1100
2007-07-20 11:51:27 AM : 1200
2007-07-20 11:51:39 AM : 1300
-----------------------------------------------CODE
BELOW---------------------------------------------
Public Sub LoadDataTable(B yVal dt As DataTable, ByVal xcol As String,
ByVal ycol As String, ByVal srs As String)
Dim dr As DataRow
Dim dc As DataColumn
Dim GMLString As String
Dim featureID As Integer = 1

GMLString = SetGMLHeader()

For Each dr In dt.Rows
GMLString &= " <gml:featureMem ber>" & vbCrLf
GMLString &= " <SML:NavPoint fid=""NavPoint. " & featureID
&
""">" & vbCrLf
GMLString &= ConvertRecord(d r, dt.Columns, xcol, ycol, srs)
GMLString &= " </SML:NavPoint>" & vbCrLf
GMLString &= " </gml:featureMemb er>" & vbCrLf
featureID += 1
If featureID Mod 100 = 0 Then
Console.WriteLi ne(Date.Now & " : " & featureID)
End If
Next

GMLString &= SetGMLFooter()

Dim memoryWriter As New StreamWriter(mG MLStream)
memoryWriter.Wr ite(GMLString)
memoryWriter.Fl ush()
'Console.WriteL ine(GMLString)
End Sub

Private Function SetGMLHeader() As String
Dim returnString As String

returnString = "<?xml version=""1.0"" encoding=""UTF-8""?>" &
vbCrLf
& vbCrLf
returnString &= "<SML:FeatureCo llection " & vbCrLf
returnString &= " xmlns=""http://www.spatialmapp ing.com/gml""" &
vbCrLf
returnString &= " xmlns:gml=""htt p://www.opengis.net/gml""" &
vbCrLf
returnString &= " xmlns:SML=""htt p://www.spatialmapp ing.com/gml"""
&
vbCrLf
returnString &= "
xmlns:xsi=""htt p://www.w3.org/2001/XMLSchema-instance"">" & vbCrLf &
vbCrLf
& vbCrLf

Return returnString

End Function

Private Function SetGMLFooter() As String
Dim returnString As String

returnString = "</SML:FeatureColl ection" & vbCrLf
Return returnString
End Function

Private Function ConvertRecord(B yVal geoRecord As DataRow, ByVal
geoColumns As DataColumnColle ction, ByVal xcol As String, ByVal ycol As
String, ByVal srs As String) As String
Dim returnString As String
For Each dc As DataColumn In geoColumns
If dc.ColumnName <xcol And dc.ColumnName <ycol Then
returnString &= " <SML:" & dc.ColumnName.T oUpper
&
">"
returnString &= geoRecord.Item( dc.ColumnName)
returnString &= "</SML:" & dc.ColumnName.T oUpper & ">" &
vbCrLf
End If
Next
returnString &= " <SML:GEOMETRY >" & vbCrLf
returnString &= " <gml:Point srsName=""" & srs &
""">"
& vbCrLf
returnString &= " <gml:coordinate s>" &
geoRecord.Item( xcol) & "," & geoRecord.Item( ycol) & "</gml:coordinates >" &
vbCrLf
returnString &= " </gml:Point>" & vbCrLf
returnString &= " </SML:GEOMETRY>" & vbCrLf

Return returnString
End Function


Jul 20 '07 #2
You should use StringBuilder instead of String when you will be
heavily modifying a string. The String class is invariant, which
means whenever you modify it a new copy is created with the changes.
If you continually append to a String, the data gets copied each time.

On Fri, 20 Jul 2007 19:11:10 GMT, "Gary Townsend"
<ga***@spatialm apping.comwrote :
>Solved it and my solution was to write to the memorystream after each
iteration.
-----------------------------CODE BELOW----------------------------------
Public Sub LoadDataTable(B yVal dt As DataTable, ByVal xcol As String,
ByVal ycol As String, ByVal srs As String)
Dim dr As DataRow
Dim dc As DataColumn
Dim GMLString As String
Dim featureID As Integer = 1

GMLString = SetGMLHeader()
Dim memoryWriter As New StreamWriter(mG MLStream)
memoryWriter.Wr ite(GMLString)
memoryWriter.Fl ush()

For Each dr In dt.Rows
GMLString = " <gml:featureMem ber>" & vbCrLf
GMLString &= " <SML:NavPoint fid=""NavPoint. " & featureID &
""">" & vbCrLf
GMLString &= ConvertRecord(d r, dt.Columns, xcol, ycol, srs)
GMLString &= " </SML:NavPoint>" & vbCrLf
GMLString &= " </gml:featureMemb er>" & vbCrLf
featureID += 1
memoryWriter.Wr ite(GMLString)
memoryWriter.Fl ush()
If featureID Mod 100 = 0 Then
Console.WriteLi ne(Date.Now & " : " & featureID)
End If
Next

GMLString &= SetGMLFooter()

memoryWriter.Wr ite(GMLString)
memoryWriter.Fl ush()
'Console.WriteL ine(GMLString)
End Sub
----------------------------------------------OUTPUT
BELOW----------------------------
2007-07-20 12:08:38 PM : 100
2007-07-20 12:08:38 PM : 200
2007-07-20 12:08:38 PM : 300
2007-07-20 12:08:38 PM : 400
2007-07-20 12:08:38 PM : 500
2007-07-20 12:08:38 PM : 600
2007-07-20 12:08:38 PM : 700
2007-07-20 12:08:38 PM : 800
2007-07-20 12:08:38 PM : 900
2007-07-20 12:08:38 PM : 1000
2007-07-20 12:08:38 PM : 1100
2007-07-20 12:08:39 PM : 1200
2007-07-20 12:08:39 PM : 1300
2007-07-20 12:08:39 PM : 1400
2007-07-20 12:08:39 PM : 1500
2007-07-20 12:08:39 PM : 1600
2007-07-20 12:08:39 PM : 1700
2007-07-20 12:08:39 PM : 1800
2007-07-20 12:08:39 PM : 1900
2007-07-20 12:08:39 PM : 2000
2007-07-20 12:08:39 PM : 2100
2007-07-20 12:08:39 PM : 2200
2007-07-20 12:08:39 PM : 2300
2007-07-20 12:08:39 PM : 2400
2007-07-20 12:08:40 PM : 2500
2007-07-20 12:08:40 PM : 2600
2007-07-20 12:08:40 PM : 2700
2007-07-20 12:08:40 PM : 2800
2007-07-20 12:08:40 PM : 2900
2007-07-20 12:08:40 PM : 3000
2007-07-20 12:08:40 PM : 3100
2007-07-20 12:08:40 PM : 3200
2007-07-20 12:08:40 PM : 3300
2007-07-20 12:08:40 PM : 3400
2007-07-20 12:08:40 PM : 3500
2007-07-20 12:08:40 PM : 3600
2007-07-20 12:08:40 PM : 3700

"Gary Townsend" <ga***@spatialm apping.comwrote in message
news:dJ7oi.594 43$xk5.14807@ed tnps82...
>I have been working on a way to take a datatable from a dataset and
transform it into a Geography Markup Language(GML) stream so it can be
loaded into another component. The problem i'm finding is that the
building
>of the string to transform it into a stream is taking longer and longer as
you add more data to the string ( as you can see from the printout below.

Any suggestions for reducing the time? Should i be writing the GML to the
memory stream right away rather than trying to build one big string and
write that to memory stream? This data table that could be coming in could
contain thousands and thousands of rows.

--------------------------------------------------------------------------
Jul 20 '07 #3
Interesting I didn't know that thanks for the tip i'll look into that.

"Jack Jackson" <ja********@peb bleridge.comwro te in message
news:ti******** *************** *********@4ax.c om...
You should use StringBuilder instead of String when you will be
heavily modifying a string. The String class is invariant, which
means whenever you modify it a new copy is created with the changes.
If you continually append to a String, the data gets copied each time.

On Fri, 20 Jul 2007 19:11:10 GMT, "Gary Townsend"
<ga***@spatialm apping.comwrote :
Solved it and my solution was to write to the memorystream after each
iteration.
-----------------------------CODE BELOW----------------------------------
Public Sub LoadDataTable(B yVal dt As DataTable, ByVal xcol As String,
ByVal ycol As String, ByVal srs As String)
Dim dr As DataRow
Dim dc As DataColumn
Dim GMLString As String
Dim featureID As Integer = 1

GMLString = SetGMLHeader()
Dim memoryWriter As New StreamWriter(mG MLStream)
memoryWriter.Wr ite(GMLString)
memoryWriter.Fl ush()

For Each dr In dt.Rows
GMLString = " <gml:featureMem ber>" & vbCrLf
GMLString &= " <SML:NavPoint fid=""NavPoint. " &
featureID &
""">" & vbCrLf
GMLString &= ConvertRecord(d r, dt.Columns, xcol, ycol, srs)
GMLString &= " </SML:NavPoint>" & vbCrLf
GMLString &= " </gml:featureMemb er>" & vbCrLf
featureID += 1
memoryWriter.Wr ite(GMLString)
memoryWriter.Fl ush()
If featureID Mod 100 = 0 Then
Console.WriteLi ne(Date.Now & " : " & featureID)
End If
Next

GMLString &= SetGMLFooter()

memoryWriter.Wr ite(GMLString)
memoryWriter.Fl ush()
'Console.WriteL ine(GMLString)
End Sub
----------------------------------------------OUTPUT
BELOW----------------------------
2007-07-20 12:08:38 PM : 100
2007-07-20 12:08:38 PM : 200
2007-07-20 12:08:38 PM : 300
2007-07-20 12:08:38 PM : 400
2007-07-20 12:08:38 PM : 500
2007-07-20 12:08:38 PM : 600
2007-07-20 12:08:38 PM : 700
2007-07-20 12:08:38 PM : 800
2007-07-20 12:08:38 PM : 900
2007-07-20 12:08:38 PM : 1000
2007-07-20 12:08:38 PM : 1100
2007-07-20 12:08:39 PM : 1200
2007-07-20 12:08:39 PM : 1300
2007-07-20 12:08:39 PM : 1400
2007-07-20 12:08:39 PM : 1500
2007-07-20 12:08:39 PM : 1600
2007-07-20 12:08:39 PM : 1700
2007-07-20 12:08:39 PM : 1800
2007-07-20 12:08:39 PM : 1900
2007-07-20 12:08:39 PM : 2000
2007-07-20 12:08:39 PM : 2100
2007-07-20 12:08:39 PM : 2200
2007-07-20 12:08:39 PM : 2300
2007-07-20 12:08:39 PM : 2400
2007-07-20 12:08:40 PM : 2500
2007-07-20 12:08:40 PM : 2600
2007-07-20 12:08:40 PM : 2700
2007-07-20 12:08:40 PM : 2800
2007-07-20 12:08:40 PM : 2900
2007-07-20 12:08:40 PM : 3000
2007-07-20 12:08:40 PM : 3100
2007-07-20 12:08:40 PM : 3200
2007-07-20 12:08:40 PM : 3300
2007-07-20 12:08:40 PM : 3400
2007-07-20 12:08:40 PM : 3500
2007-07-20 12:08:40 PM : 3600
2007-07-20 12:08:40 PM : 3700

"Gary Townsend" <ga***@spatialm apping.comwrote in message
news:dJ7oi.5944 3$xk5.14807@edt nps82...
I have been working on a way to take a datatable from a dataset and
transform it into a Geography Markup Language(GML) stream so it can be
loaded into another component. The problem i'm finding is that the
building
of the string to transform it into a stream is taking longer and longer
as
you add more data to the string ( as you can see from the printout
below.
>
Any suggestions for reducing the time? Should i be writing the GML to
the
memory stream right away rather than trying to build one big string and
write that to memory stream? This data table that could be coming in
could
contain thousands and thousands of rows.
>-------------------------------------------------------------------------
-
Jul 20 '07 #4
Me too, I didn't know it either. I'll look into it. Thanks.

Al G
"Gary Townsend" <ga***@spatialm apping.comwrote in message
news:4b8oi.5944 7$xk5.40337@edt nps82...
Interesting I didn't know that thanks for the tip i'll look into that.

"Jack Jackson" <ja********@peb bleridge.comwro te in message
news:ti******** *************** *********@4ax.c om...
>You should use StringBuilder instead of String when you will be
heavily modifying a string. The String class is invariant, which
means whenever you modify it a new copy is created with the changes.
If you continually append to a String, the data gets copied each time.

On Fri, 20 Jul 2007 19:11:10 GMT, "Gary Townsend"
<ga***@spatial mapping.comwrot e:
>Solved it and my solution was to write to the memorystream after each
iteration.
-----------------------------CODE
BELOW----------------------------------
Public Sub LoadDataTable(B yVal dt As DataTable, ByVal xcol As
String,
ByVal ycol As String, ByVal srs As String)
Dim dr As DataRow
Dim dc As DataColumn
Dim GMLString As String
Dim featureID As Integer = 1

GMLString = SetGMLHeader()
Dim memoryWriter As New StreamWriter(mG MLStream)
memoryWriter.Wr ite(GMLString)
memoryWriter.Fl ush()

For Each dr In dt.Rows
GMLString = " <gml:featureMem ber>" & vbCrLf
GMLString &= " <SML:NavPoint fid=""NavPoint. " &
featureID &
>""">" & vbCrLf
GMLString &= ConvertRecord(d r, dt.Columns, xcol, ycol, srs)
GMLString &= " </SML:NavPoint>" & vbCrLf
GMLString &= " </gml:featureMemb er>" & vbCrLf
featureID += 1
memoryWriter.Wr ite(GMLString)
memoryWriter.Fl ush()
If featureID Mod 100 = 0 Then
Console.WriteLi ne(Date.Now & " : " & featureID)
End If
Next

GMLString &= SetGMLFooter()

memoryWriter.Wr ite(GMLString)
memoryWriter.Fl ush()
'Console.WriteL ine(GMLString)
End Sub
----------------------------------------------OUTPUT
BELOW----------------------------
2007-07-20 12:08:38 PM : 100
2007-07-20 12:08:38 PM : 200
2007-07-20 12:08:38 PM : 300
2007-07-20 12:08:38 PM : 400
2007-07-20 12:08:38 PM : 500
2007-07-20 12:08:38 PM : 600
2007-07-20 12:08:38 PM : 700
2007-07-20 12:08:38 PM : 800
2007-07-20 12:08:38 PM : 900
2007-07-20 12:08:38 PM : 1000
2007-07-20 12:08:38 PM : 1100
2007-07-20 12:08:39 PM : 1200
2007-07-20 12:08:39 PM : 1300
2007-07-20 12:08:39 PM : 1400
2007-07-20 12:08:39 PM : 1500
2007-07-20 12:08:39 PM : 1600
2007-07-20 12:08:39 PM : 1700
2007-07-20 12:08:39 PM : 1800
2007-07-20 12:08:39 PM : 1900
2007-07-20 12:08:39 PM : 2000
2007-07-20 12:08:39 PM : 2100
2007-07-20 12:08:39 PM : 2200
2007-07-20 12:08:39 PM : 2300
2007-07-20 12:08:39 PM : 2400
2007-07-20 12:08:40 PM : 2500
2007-07-20 12:08:40 PM : 2600
2007-07-20 12:08:40 PM : 2700
2007-07-20 12:08:40 PM : 2800
2007-07-20 12:08:40 PM : 2900
2007-07-20 12:08:40 PM : 3000
2007-07-20 12:08:40 PM : 3100
2007-07-20 12:08:40 PM : 3200
2007-07-20 12:08:40 PM : 3300
2007-07-20 12:08:40 PM : 3400
2007-07-20 12:08:40 PM : 3500
2007-07-20 12:08:40 PM : 3600
2007-07-20 12:08:40 PM : 3700

"Gary Townsend" <ga***@spatialm apping.comwrote in message
news:dJ7oi.594 43$xk5.14807@ed tnps82...
I have been working on a way to take a datatable from a dataset and
transform it into a Geography Markup Language(GML) stream so it can be
loaded into another component. The problem i'm finding is that the
building
of the string to transform it into a stream is taking longer and
longer
as
>you add more data to the string ( as you can see from the printout
below.
>>
Any suggestions for reducing the time? Should i be writing the GML to
the
>memory stream right away rather than trying to build one big string
and
write that to memory stream? This data table that could be coming in
could
>contain thousands and thousands of rows.
>>-------------------------------------------------------------------------
-


Jul 20 '07 #5
"Al G" <ag*******@char ter.netwrote in
news:ek******** *****@newsfe03. lga:
Me too, I didn't know it either. I'll look into it. Thanks.

Al G

StringBuilder makes a MASSIVE difference in speed - especially when you're
in the 1MB+ range :-)

Jul 21 '07 #6

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

Similar topics

22
7433
by: Bryan Rickard | last post by:
I wrote a simple program in VB6 to copy all the files from a directory on a CD-ROM to my hard disk. There are about 10 files, each about 30MB. The program uses Get and Put to get data from the CD into a buffer and then put it into the disk. See code below. It works, but it slows down drastically before it copies all the files. Windows Task Manager shows the CPU usage gradually increasing as the files are copied, until it reaches 100...
1
2433
by: picard | last post by:
I have seen in various posts that there are tricks to increasing the largest continuous memory block available to an application on a windows machine. I want to prove this is possible using a simple example. Here is my configuration. -I am running vc++ 6.0 on winXP. (Came with book Starting with Visual C++ by Wright) -I have the 3GB switch set at run time
100
3644
by: jacob navia | last post by:
As everybody knows, C uses a zero delimited unbounded pointer for its representation of strings. This is extremely inefficient because at each query of the length of the string, the computer starts an unbounded memory scan searching for a zero that ends the string. A more efficient representation is: struct string {
3
9512
by: Nick | last post by:
I have found a class that compresses and uncompresses data but need some help with how to use part of it below is the deflate method which compresses the string that I pass in, this works OK. At the end of this message is the inflate method this is where I get stuck I know that I need a byte array but because I am decompressing a string I have no idea of how big the byte array will need to be in the end (the inflate and deflate methods...
15
5019
by: Joe Lester | last post by:
I installed Postgres 7.4.1 on a dual processor G5 running Mac OS 10.3.2. I'm trying to increase the max_connections to 300 and running into some trouble. If anyone could shed some light, I'd greatly appreciate it. Here's part of my postgresql.conf: # - Connection Settings - tcpip_socket = true max_connections = 300
4
8268
by: Rahul B | last post by:
Hi, I was getting the error: sqlcode: -911 sqlstate: 40001 , which is "The maximum number of lock requests has been reached for the database." So i increased the locklist size to 200 from the default value of 100. I wanted to know what other effects it will have on the database? Like, will the performance reduce, if the locklist size is 200 and 120 locks are on it as compared to when the locklist size is 130 and 120
3
1342
by: chrispy102 | last post by:
Hi all, I have an MDI app developed using vis studio 2005. The problem I have is that evey time I close a Child form and open another, the CPU PF Usage increments slighty. This happens every time you change child forms until you run out of memory upon which you get a System.OutOfMemoryException. Is there something subtle I'm missing about dealing with opening/closing MDIChild forms? I have made sure only 1 child is open at one time and...
0
1389
by: wajedali | last post by:
hi......... i have problem in incresing and decreasing the component. I have a one main panel (i.e. i used as _basewindowPanel) in that again two panel in that two panel like wise.... now when i m increasing the size of component only button and label size get increase.But Jcombobox,JTextfield and table size unchanged.Plz any one help me,here is my code for increasing the size........ public void incPanel(int size) { ...
4
6355
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
Visual Studio 2005, C# WinForms application: Here’s the question: How can I increase the standard 1 MB stack size of the UI thread in a C# WinForms application? Here’s why I ask: I’ve inherited some code that at the view (User Interface) layer kicks off a background worker thread. At the service layer (think CAB service layer), there’s quite a lot of the following:
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10106
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
10039
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
9914
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...
0
8937
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7461
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
5355
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...
1
4009
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.