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

XMLtextWriter speed test

2
I am writing a large XML file that consists of multiple identical intervals of data. Each interval is around 10 MB and I am timing how long it takes to write the file. My timer shows that the first interval takes 4 seconds while the last takes 79 seconds. Graphing the time for all intervals shows a fairly straight line. I am suspecting that a full file seek is done before each write. I am wondering if this is a known problem and whether there is a way to eliminate this behavior. By the way, reading the file shows similar behavior although much much faster.
Mar 27 '07 #1
3 1547
dorinbogdan
839 Expert 512MB
Welcome to TheScripts TSDN...

Did you try to use XMLDocument? Or a temp file?

If not already seen, read this article, it will be helpful.

Dorin.
Mar 28 '07 #2
dorinbogdan
839 Expert 512MB
Also, it may increase the performance if use a combination of XMLTextWriter and XMLDocument, like this method.
Mar 28 '07 #3
billz
2
So in this article, where the example shows how to create the "big" xml file, consider running it with timers at every 1000 lines. You will see that each 1000 lines will take longer to be created. That's the issue I am dealing with rather than appending to the file after the fact (that's for later).




Welcome to TheScripts TSDN...

Did you try to use XMLDocument? Or a temp file?

If not already seen, read this article, it will be helpful.

Dorin.
Mar 28 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: reddy | last post by:
I am trying to insert a node into an XMLFile. using XMLTextwriter. My Question is Is it possible to do without using XMLDocument. Because its loading all the the file into memory. I just want to...
4
by: Chris | last post by:
Hi, I'm stumped and could use some suggestions. I'm trying to serialize some data to an XML fragment in string form, then deserialize it from a string back to an XML fragment, from which I...
1
by: Johan Klijn | last post by:
Can somebody explain why the endElement (</items>) in the following sample is not written? Public Sub Test() Dim objMem As New MemoryStream Dim objWriter As New XmlTextWriter(objMem, New...
2
by: Steve Gilbey | last post by:
I have a dataset from which I need to extract certain columns, format them into xml and output to an xmldocument object. From reading various posts on similar subjects, I have come up with the...
4
by: Einar Høst | last post by:
Hi, I'm having weird problems using StringWriter and XmlTextWriter. My code looks like this: StringWriter sw = new StringWriter(CultureInfo.InvariantInfo); XmlTextWriter xtw = new...
2
by: quest | last post by:
XmlTextWriter writer = new XmlTextWriter("c:\\myxml.xml", System.Text.Encoding.UTF8); writer.WriteStartDocument(true); writer.WriteStartElement("Heading"); writer.WriteAttributeString("Ver",...
1
by: Mori | last post by:
I want to use the XMLTextWriter to build and xml stream and then display or pass the xml to another method. I do not wish to persist the xml. I am using the Memory stream to store the xml but I...
2
by: Mori | last post by:
I am using the following code to manufactue xml using xmltextwriter. The xml is okay except for the extra set of start document and the outer <string> element. Where do they come from and how do...
4
by: quest | last post by:
Is there anyway I can generate the xml in the following format using XmlTextWriter ? Intended output: <?xml version="1.0" ?> I tried: XmlTextWriter xmlWriter = new...
3
by: Mat | last post by:
Hi all. I can't understand the problem with my code... I wrote a simple test function to write an XML document and in the resulting file I find 3 strange chars before the document starting. ===...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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
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...

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.